diff --git a/backend/bin/doctrine.php b/backend/bin/doctrine.php index df24c7a..f30be4b 100644 --- a/backend/bin/doctrine.php +++ b/backend/bin/doctrine.php @@ -1,4 +1,4 @@ -addCommands(array( )); $cli->run(); -?> +?> \ No newline at end of file diff --git a/backend/index.php b/backend/index.php index 581b3bb..b421caf 100644 --- a/backend/index.php +++ b/backend/index.php @@ -54,4 +54,4 @@ $r = new Router(); $r->run(); $r->view->send(); -?> +?> \ No newline at end of file diff --git a/backend/lib/Iterator/DataIterator.php b/backend/lib/Iterator/DataIterator.php index 07dd091..9e9b122 100644 --- a/backend/lib/Iterator/DataIterator.php +++ b/backend/lib/Iterator/DataIterator.php @@ -33,7 +33,7 @@ class DataIterator implements \Iterator, \Countable { protected $current; protected $key; // incrementing key protected $stmt; // PDOStatement - protected $size; // total readings in PDOStatement + protected $size; // total readings in PDOStatement /** * Constructor diff --git a/backend/lib/Model/Aggregator.php b/backend/lib/Model/Aggregator.php index 893ae0a..63d58c9 100644 --- a/backend/lib/Model/Aggregator.php +++ b/backend/lib/Model/Aggregator.php @@ -85,7 +85,7 @@ class Aggregator extends Entity { } public function removeAggregator(Aggregator $child) { - $this->children->removeElement($child); + return $this->children->removeElement($child); } /** @@ -93,20 +93,22 @@ class Aggregator extends Entity { * * @param Channel $child * @todo check if the channel is already member of the group - * @todo add bidrection association + * @todo add bidrectional association */ public function addChannel(Channel $child) { $this->channels->add($child); } public function removeChannel(Channel $child) { - $this->channels->removeElement($child); + return $this->channels->removeElement($child); } - /** - * @todo return array via ArrayCollection::toArray()? + /* + * Setter & getter */ - public function getChannels() { return $this->channels; } + public function getChannels() { return $this->channels->toArray(); } + public function getChildren() { return $this->children->toArray(); } } + ?> \ No newline at end of file diff --git a/backend/lib/Model/Data.php b/backend/lib/Model/Data.php index d93e711..03b07fb 100644 --- a/backend/lib/Model/Data.php +++ b/backend/lib/Model/Data.php @@ -70,8 +70,7 @@ class Data { */ protected $channel; - public function __construct(Model\Channel $channel, $value, $timestamp) { - $channel->addData($this); // bidirectional association + public function __construct(Model\Channel $channel, $timestamp, $value) { $this->channel = $channel; $this->value = $value; diff --git a/backend/lib/Model/EntityDefinition.php b/backend/lib/Model/EntityDefinition.php index c79665c..85ff2eb 100644 --- a/backend/lib/Model/EntityDefinition.php +++ b/backend/lib/Model/EntityDefinition.php @@ -66,7 +66,7 @@ class EntityDefinition extends Definition { protected $unit; /** - * @todo url relative or absolute? + * Relative url to an icon * @var string */ protected $icon; diff --git a/backend/lib/Model/Token.php b/backend/lib/Model/Token.php index 4865ad6..ae8b560 100644 --- a/backend/lib/Model/Token.php +++ b/backend/lib/Model/Token.php @@ -30,6 +30,7 @@ use Volkszaehler\Util; * * @author Steffen Vogel * @package default + * @todo this is a draft! has to be discussed and implemented * * @Entity * @Table(name="tokens") diff --git a/backend/lib/Util/Configuration.php b/backend/lib/Util/Configuration.php index 85a329f..7ba0935 100644 --- a/backend/lib/Util/Configuration.php +++ b/backend/lib/Util/Configuration.php @@ -28,6 +28,7 @@ namespace Volkszaehler\Util; * * @package util * @author Steffen Vogel + * @todo why not with json? */ class Configuration { static protected $values = array(); diff --git a/backend/lib/Util/Debug.php b/backend/lib/Util/Debug.php index 0dcc55d..aa3a012 100644 --- a/backend/lib/Util/Debug.php +++ b/backend/lib/Util/Debug.php @@ -66,7 +66,7 @@ class Debug { self::$instance = $this; // assert options - assert_options(ASSERT_ACTIVE, TRUE); + assert_options(ASSERT_ACTIVE, TRUE); // activate assertions assert_options(ASSERT_BAIL, FALSE); assert_options(ASSERT_WARNING, FALSE); assert_options(ASSERT_CALLBACK, array($this, 'assertHandler')); @@ -98,7 +98,6 @@ class Debug { * simple assertion passthrough for future improvements * * @param string $code code to be evaluated - * @todo check how should be en/disabled (options etc..) */ public static function assert($code) { return assert($code); @@ -147,7 +146,7 @@ class Debug { /** * @return Debug the Debug instance if available - * @todo OOP? Should we remove this? Replace by State class? + * @todo encapsulate in state class? or inherit from singleton class? */ public static function getInstance() { return self::$instance; } }