Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
collection to array
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Szadkowski committed Jul 29, 2015
1 parent abc0865 commit 0a601ff
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Cleeng/Entity/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 0a601ff

Please sign in to comment.