Pop\Db\Record\Prepared::execute PHP Метод

execute() публичный Метод

Execute a custom prepared SQL query.
public execute ( string $sql, array $params = null ) : void
$sql string
$params array
Результат void
    public function execute($sql, $params = null)
    {
        $this->sql->adapter()->prepare($sql);
        if (null !== $params && is_array($params)) {
            $this->sql->adapter()->bindParams((array) $params);
        }
        $this->sql->adapter()->execute();
        // Set the return results.
        if (stripos($sql, 'select') !== false) {
            $this->setResults();
        } else {
            if (stripos($sql, 'delete') !== false) {
                $this->columns = array();
                $this->rows = array();
            }
        }
    }