. */ namespace Volkszaehler\Model; use Doctrine\Common\Collections\ArrayCollection; /** * Channel entity * * @author Steffen Vogel * @package default * * @Entity */ class Channel extends Entity { /** * @OneToMany(targetEntity="Data", mappedBy="channel", cascade={"remove", "persist"}) * @OrderBy({"timestamp" = "ASC"}) */ protected $data = NULL; /** @ManyToMany(targetEntity="Aggregator", mappedBy="channels") */ protected $aggregators; /** * Constructor */ public function __construct($type, $properties = array()) { parent::__construct($type, $properties); $this->data = new ArrayCollection(); $this->groups = new ArrayCollection(); } /** * Add a new data to the database * @todo move to Logger\Logger? */ public function addData(\Volkszaehler\Model\Data $data) { $this->data->add($data); } } ?>