Skip to content
Browse files

Fixing 5.3 variable reference issue in `Model`.

  • Loading branch information...
1 parent 40940ad commit f4c5bd2f235420251ca4d8e01301eb9534cfb7cc @nateabele nateabele committed
Showing with 7 additions and 6 deletions.
  1. +7 −6 data/Model.php
View
13 data/Model.php
@@ -394,21 +394,22 @@ protected static function _init($class) {
$local = compact('class', 'name') + $self->_meta;
$self->_meta = ($local + $source['meta'] + $meta);
+ $meta =& $self->_meta;
if (is_object($schema)) {
$schema = $schema->fields();
}
$self->_initializers += array(
- 'source' => function() use (&$self) {
- return Inflector::tableize($self->_meta['name']);
+ 'source' => function() use (&$meta) {
+ return Inflector::tableize($meta['name']);
},
- 'title' => function() use (&$self, $class) {
+ 'title' => function() use (&$meta) {
$titleKeys = array('title', 'name');
- if (isset($self->_meta['key'])) {
- $titleKeys = array_merge($titleKeys, (array) $self->_meta['key']);
+ if (isset($meta['key'])) {
+ $titleKeys = array_merge($titleKeys, (array) $meta['key']);
}
- return $class::hasField($titleKeys);
+ return $meta['class']::hasField($titleKeys);
}
);

0 comments on commit f4c5bd2

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