コード例 #1
0
ファイル: Client.php プロジェクト: robgridley/pace-api
 /**
  * Dynamically retrieve the specified model.
  *
  * @param string $name
  * @return Model
  */
 public function __get($name)
 {
     return $this->model(Type::modelify($name));
 }
コード例 #2
0
ファイル: TypeTest.php プロジェクト: robgridley/pace-api
 public function testSingularizeMethod()
 {
     $this->assertEquals('jobStatus', Type::singularize('jobStatus'));
     $this->assertEquals('jobStatus', Type::singularize('jobStatuses'));
 }
コード例 #3
0
ファイル: Model.php プロジェクト: robgridley/pace-api
 /**
  * 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);
 }