Skip to content
This repository
Browse code

Fix trailing whitespaces.

  • Loading branch information...
commit 894ede4e97019615b65582addf3227db5d683c36 1 parent 70fcb80
Yoan Blanc authored May 06, 2012

Showing 1 changed file with 3 additions and 13 deletions. Show diff stats Hide diff stats

  1. 16  lib/Relationship.php
16  lib/Relationship.php
@@ -651,24 +651,14 @@ public function __construct($options=array())
651 651
 			$this->foreign_key = array(Inflector::instance()->keyify($this->class_name));
652 652
 	}
653 653
 
654  
-	/**
655  
-	 * Magic method, the getter. Lazy calculation of the primary_key. 
656  
-	 * Aside from a slight performance gain it prevents an error when the 
657  
-	 * referenced table doesn't exist yet (the relation is marked but the 
658  
-	 * table doesn't exist and all the foreign keys are null).
659  
-	 * 
660  
-	 * Why is this needed only in BelongsTo? Because for HasOne/Many the primary key 
661  
-	 * always exists. In those cases we can't be sure about the foreign key, but that's 
662  
-	 * infered without SQL queries
663  
-	 */
664 654
 	public function __get($name)
665 655
 	{
666  
-		if($name=='primary_key' && !isset($this->primary_key)) {
  656
+		if($name === 'primary_key' && !isset($this->primary_key)) {
667 657
 			$this->primary_key = array(Table::load($this->class_name)->pk[0]);
668 658
 		}
669  
-		return @$this->$name;
670  
-	}	
671 659
 
  660
+		return $this->$name;
  661
+	}
672 662
 
673 663
 	public function load(Model $model)
674 664
 	{

0 notes on commit 894ede4

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