Created
October 3, 2011 20:40
-
-
Save tarnfeld/1260175 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // First off, change | |
| public function __construct($table, $id) .. | |
| // to | |
| public function __construct($table, $id = null) .. | |
| // then only use the $id part if its not null | |
| public static function create($table, array $properties) { | |
| $x = new self($table); | |
| foreach($properties as $k => $v) { | |
| $x->{$k} = $v; | |
| } | |
| return $x; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment