for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ajir\RabbitMqSqlBundle\Model;
use Ajir\RabbitMqSqlBundle\DataMapper\DataMapper;
use Ajir\RabbitMqSqlBundle\DataTransformer\DataTransformer;
/**
* Class OneToManyRelation
*
* @author Florian Ajir <[email protected]>
*/
class OneToManyRelation extends AbstractRelation implements RelationInterface
{
* @var array
protected $entities;
protected $references;
* @var bool
protected $removeReferenced;
* @param array $data
public function __construct(array $data)
parent::__construct($data);
$relation = $data[DataTransformer::RELATED_RELATION_KEY];
$joinColumn = $relation[DataMapper::RELATION_KEY_JOIN_COLUMN];
$this->joinColumnName = $joinColumn[DataMapper::RELATION_KEY_JOIN_COLUMN_NAME];
$this->joinColumnReferencedColumnName =
$joinColumn[DataMapper::RELATION_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME];
$this->entities = $data[DataTransformer::RELATED_DATA_KEY];
$this->references = isset($relation[DataMapper::REFERENCES_KEY]) ?
$relation[DataMapper::REFERENCES_KEY] : array();
$this->removeReferenced = isset($relation[DataMapper::REMOVE_REFERENCED_KEY])
&& $relation[DataMapper::REMOVE_REFERENCED_KEY] == 'true';
}
* @return array
public function getEntities()
return $this->entities;
public function getReferences()
return $this->references;
* @return boolean
public function isRemoveReferenced()
return $this->removeReferenced;