Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Since logic moved to ObjectAccessor we can simplify things here.

  • Loading branch information...
commit 8b1e4b1101f425ab256feba894e37168d34b4721 1 parent 3115a9a
@drpheltright drpheltright authored
Showing with 1 addition and 27 deletions.
  1. +1 −27 classes/TheCure/Models/Magic.php
View
28 classes/TheCure/Models/Magic.php
@@ -105,32 +105,6 @@ private function relationship(Attributes $attributes, $method, array $args)
}
/**
- * Get value from $object or use default $field value.
- *
- * @param Object
- * @param Field
- * @return mixed
- */
- private function value(Object $object, Field $field)
- {
- if (isset($object->{$field->name()}))
- {
- $value = $object->{$field->name()};
- }
- else
- {
- $value = $field->value();
-
- if (is_callable($value))
- {
- $value = $value($object);
- }
- }
-
- return $value;
- }
-
- /**
* The magic of this object!
*
* @param string $method
@@ -158,7 +132,7 @@ public function __call($method, $args)
}
else
{
- return $this->value($object, $field);
+ return $accessor->get_field_value($this, $field);
}
}
else
Please sign in to comment.
Something went wrong with that request. Please try again.