Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix trailing whitespaces.

  • Loading branch information...
commit 894ede4e97019615b65582addf3227db5d683c36 1 parent 70fcb80
@greut greut authored
Showing with 3 additions and 13 deletions.
  1. +3 −13 lib/Relationship.php
View
16 lib/Relationship.php
@@ -651,24 +651,14 @@ public function __construct($options=array())
$this->foreign_key = array(Inflector::instance()->keyify($this->class_name));
}
- /**
- * Magic method, the getter. Lazy calculation of the primary_key.
- * Aside from a slight performance gain it prevents an error when the
- * referenced table doesn't exist yet (the relation is marked but the
- * table doesn't exist and all the foreign keys are null).
- *
- * Why is this needed only in BelongsTo? Because for HasOne/Many the primary key
- * always exists. In those cases we can't be sure about the foreign key, but that's
- * infered without SQL queries
- */
public function __get($name)
{
- if($name=='primary_key' && !isset($this->primary_key)) {
+ if($name === 'primary_key' && !isset($this->primary_key)) {
$this->primary_key = array(Table::load($this->class_name)->pk[0]);
}
- return @$this->$name;
- }
+ return $this->$name;
+ }
public function load(Model $model)
{
Please sign in to comment.
Something went wrong with that request. Please try again.