Esempio n. 1
0
 /**
  * Dynamically retrieve the specified model.
  *
  * @param string $name
  * @return Model
  */
 public function __get($name)
 {
     return $this->model(Type::modelify($name));
 }
Esempio n. 2
0
 public function testSingularizeMethod()
 {
     $this->assertEquals('jobStatus', Type::singularize('jobStatus'));
     $this->assertEquals('jobStatus', Type::singularize('jobStatuses'));
 }
Esempio n. 3
0
 /**
  * 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);
 }