diff --git a/src/Cleeng/Entity/Base.php b/src/Cleeng/Entity/Base.php index 9f36aef..0ae0b80 100644 --- a/src/Cleeng/Entity/Base.php +++ b/src/Cleeng/Entity/Base.php @@ -41,6 +41,20 @@ public function populate($data) $this->pending = false; } + /** + * Convert collection into array + * + * @return array + */ + public function toArray() + { + $data = array(); + foreach ($this as $k => $v) { + $data[$k] = $v; + } + return $data; + } + /** * Class constructor *