Skip to content
Browse files

more smart scope-guess mechanism

  • Loading branch information...
1 parent 35c71ae commit 334493daff2ae284de7c4f974f9f229743cfaefd @d1rk d1rk committed Mar 11, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 models/Activities.php
View
2 models/Activities.php
@@ -117,6 +117,8 @@ public static function getScope(array $data = array()) {
foreach($data as $key => $item) {
if ($item instanceof Entity) {
$scope[sprintf('%s_id', $key)] = (string) $item->{$item->key()};
+ } elseif (is_array($item) && isset($item['_id'])) {
+ $scope[$key] = (string) $item['_id'];
} elseif (preg_match('/^(.+)_id$/', $key, $matches) && is_scalar($item)) {
list($attribute, $name) = $matches;
$scope[$attribute] = (string) $item;

0 comments on commit 334493d

Please sign in to comment.
Something went wrong with that request. Please try again.