Ejemplo n.º 1
0
 /**
  * idを指定して1つのResourceを取得する
  * @param $id
  * @param $column
  * @return mixed
  */
 public function getResource($id, $column = array())
 {
     $builder = new DbConditions();
     $params = $builder->equal('id', $id);
     if (!empty($column)) {
         $params->select($column);
     }
     return $this->model->find($params->build());
 }
Ejemplo n.º 2
0
 public function testOR()
 {
     $expected = ['conditions' => 'test1 = :test1: OR test2 > :test2:', 'bind' => ['test1' => 'value1', 'test2' => 'value2']];
     $actual = $this->obj->equal('test1', 'value1')->or()->greaterThan('test2', 'value2')->build();
     $this->assertEquals($expected, $actual);
 }