Prado\Data\DataGateway\TDataGatewayCommand::getSqlCommand PHP Метод

getSqlCommand() защищенный Метод

Build sql command from the criteria. Limit, Offset and Ordering are applied if applicable.
protected getSqlCommand ( TSqlCriteria $criteria ) : TDbCommand
$criteria TSqlCriteria
Результат TDbCommand command corresponding to the criteria.
    protected function getSqlCommand($criteria)
    {
        $sql = $criteria->getCondition();
        $ordering = $criteria->getOrdersBy();
        $limit = $criteria->getLimit();
        $offset = $criteria->getOffset();
        if (count($ordering) > 0) {
            $sql = $this->getBuilder()->applyOrdering($sql, $ordering);
        }
        if ($limit >= 0 || $offset >= 0) {
            $sql = $this->getBuilder()->applyLimitOffset($sql, $limit, $offset);
        }
        $command = $this->getBuilder()->createCommand($sql);
        $this->getBuilder()->bindArrayValues($command, $criteria->getParameters()->toArray());
        $this->onCreateCommand($command, $criteria);
        return $command;
    }