コード例 #1
0
 /**
  * @test
  */
 public function itShouldThrowExceptionIfDirectionNotValid()
 {
     $column = new Column('registration_date', 'user');
     $order = new OrderBy($column, OrderBy::ASC);
     $this->setExpectedException('\\InvalidArgumentException');
     $order->setDirection('this is not a valid direction');
 }
コード例 #2
0
 /**
  * @param OrderBy $orderBy
  *
  * @return string
  */
 public function writeOrderBy(OrderBy $orderBy)
 {
     $column = $this->columnWriter->writeColumn($orderBy->getColumn());
     return $column . ' ' . $orderBy->getDirection();
 }