revert eloquent back to 3.2.3
This commit is contained in:
@@ -255,22 +255,7 @@ abstract class Model {
|
||||
*/
|
||||
public function _with($includes)
|
||||
{
|
||||
$includes = (array) $includes;
|
||||
|
||||
$this->includes = array();
|
||||
|
||||
foreach ($includes as $relationship => $constraints)
|
||||
{
|
||||
// When eager loading relationships, constraints may be set on the eager
|
||||
// load definition; however, is none are set, we need to swap the key
|
||||
// and the value of the array since there are no constraints.
|
||||
if (is_numeric($relationship))
|
||||
{
|
||||
list($relationship, $constraints) = array($constraints, null);
|
||||
}
|
||||
|
||||
$this->includes[$relationship] = $constraints;
|
||||
}
|
||||
$this->includes = (array) $includes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -533,7 +518,7 @@ abstract class Model {
|
||||
|
||||
foreach ($this->attributes as $key => $value)
|
||||
{
|
||||
if ( ! array_key_exists($key, $this->original) or $value !== $this->original[$key])
|
||||
if ( ! isset($this->original[$key]) or $value !== $this->original[$key])
|
||||
{
|
||||
$dirty[$key] = $value;
|
||||
}
|
||||
@@ -567,7 +552,6 @@ abstract class Model {
|
||||
* Get a given attribute from the model.
|
||||
*
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_attribute($key)
|
||||
{
|
||||
@@ -723,7 +707,7 @@ abstract class Model {
|
||||
{
|
||||
foreach (array('attributes', 'relationships') as $source)
|
||||
{
|
||||
if (array_key_exists($key, $this->$source)) return !is_null($this->$source[$key]);
|
||||
if (array_key_exists($key, $this->$source)) return true;
|
||||
}
|
||||
|
||||
if (method_exists($this, $key)) return true;
|
||||
@@ -754,7 +738,7 @@ abstract class Model {
|
||||
{
|
||||
$meta = array('key', 'table', 'connection', 'sequence', 'per_page', 'timestamps');
|
||||
|
||||
// If the method is actually the name of a static property on the model, we'll
|
||||
// If the method is actually the name of a static property on the model we'll
|
||||
// return the value of the static property. This makes it convenient for
|
||||
// relationships to access these values off of the instances.
|
||||
if (in_array($method, $meta))
|
||||
@@ -764,7 +748,7 @@ abstract class Model {
|
||||
|
||||
$underscored = array('with', 'find');
|
||||
|
||||
// Some methods need to be accessed both statically and non-statically so we'll
|
||||
// Some methods need to be accessed both staticly and non-staticly so we'll
|
||||
// keep underscored methods of those methods and intercept calls to them
|
||||
// here so they can be called either way on the model instance.
|
||||
if (in_array($method, $underscored))
|
||||
|
||||
Reference in New Issue
Block a user