Prado\Data\DataGateway\TSqlCriteria::getCondition PHP Method

getCondition() public method

public getCondition ( ) : string
return string search conditions.
    public function getCondition()
    {
        return $this->_condition;
    }

Usage Example

 /**
  * @param TSqlCriteria $criteria
  * @return integer number of records.
  */
 public function count($criteria)
 {
     if ($criteria === null) {
         return (int) $this->getBuilder()->createCountCommand()->queryScalar();
     }
     $where = $criteria->getCondition();
     $parameters = $criteria->getParameters()->toArray();
     $ordering = $criteria->getOrdersBy();
     $limit = $criteria->getLimit();
     $offset = $criteria->getOffset();
     $command = $this->getBuilder()->createCountCommand($where, $parameters, $ordering, $limit, $offset);
     $this->onCreateCommand($command, $criteria);
     return $this->onExecuteCommand($command, (int) $command->queryScalar());
 }