/** * Dynamically retrieve the specified model. * * @param string $name * @return Model */ public function __get($name) { return $this->model(Type::modelify($name)); }
public function testSingularizeMethod() { $this->assertEquals('jobStatus', Type::singularize('jobStatus')); $this->assertEquals('jobStatus', Type::singularize('jobStatuses')); }
/** * Attempt to guess the primary key field. * * @return string */ protected function guessPrimaryKey() { if ($this->hasProperty(Client::PRIMARY_KEY)) { return Client::PRIMARY_KEY; } if ($this->hasProperty('id')) { return 'id'; } return Type::camelize($this->type); }