Permalink
Browse files

Adding way to get values of all entity properties

  • Loading branch information...
1 parent db2d00a commit 5d32bb45f3484bac04a2bb12724dd253a7caf204 @mariano committed Mar 6, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 models/BaseEntity.php
View
@@ -189,10 +189,11 @@ public function set(array $data, array $whitelist = array(), $useWhitelist = tru
*
* @see IModel::validates()
* @param string $name Optionally included field name.
+ * @param bool $allProperties If true, get also properties without getter methods
* @return mixed Entire data array if $name is empty, otherwise the value from the named field.
*/
- public function data($name = null) {
- $data = $this->_getData();
+ public function data($name = null, $allProperties = false) {
+ $data = $this->_getData($allProperties);
if (isset($name)) {
return array_key_exists($name, $data) ? $data[$name] : null;
}

0 comments on commit 5d32bb4

Please sign in to comment.