Bind results

@return bool
@access protected
356310
protected function bindResult()/*# : bool */
    {
        // get fields first
        if (!$this->getFields()) {
            return false;
        }

        // bind values
        if (null === $this->vals) {
            $this->vals = array_fill(0, count($this->cols), null);

            $refs = [];
            foreach ($this->vals as $i => &$f) {
                $refs[$i] = &$f;
            }
            call_user_func_array([$this->statement, 'bind_result'], $refs);
        }
        return true;
    }
936636
protected function store($results)
    {
        $results->each(function ($model) {
            if (! isset($this->connection)) {
                $model->setConnection($model->newQueryWithoutScopes()->getConnection()->getName());
            }

            $model->save();
        });
    }
1290823
private function fetchLoadValues(): bool
    {
        $row = $this->result()->fetchRow();
        if (false === $row) {
            $this->originalValues = null;
            $this->values = [];
            return false;
        }
        $this->originalValues = $this->setValuesFromDatafields($row);
        $this->values = $this->originalValues;
        return true;
    }
945503
final protected function prepareResult()
    {
        $args = func_get_args();
        $result = array_shift($args);

        if ($result && $result !== false) {
            return $this->callHydrator($result, $args);
        } else {
            return false;
        }
    }
595926
function query() {
    ldap_servers_module_load_include('php', 'ldap_servers', 'LdapServer.class');
    $ldap_server = new LdapServer($this->sid);
    $ldap_server->connect();
    $ldap_server->bind();
    $results = array();

    $count = 0;

    foreach ($this->baseDn as $base_dn) {
      $result = $ldap_server->search($base_dn, $this->filter, $this->attributes, 0, $this->sizelimit, $this->timelimit, $this->deref, $this->scope);
      if ($result !== FALSE && $result['count'] > 0) {
        $count = $count + $result['count'];
        $results = array_merge($results, $result);
      }
    }
    $results['count'] = $count;

    return $results;
  }
1183651
public function Bind()
	{
		$this->getAbstractNode(0)->Bind();
		/**
		 * @var QName $qname
		 */
		$qname = $this->getQNVarName();
		$this->_varRef = $this->getContext()->RunningContext->NameBinder->PushVar( $qname );
		$this->getAbstractNode(1)->Bind();
		$this->getContext()->RunningContext->NameBinder->PopVar();
	}
122838
public function free_result()
	{
		if (is_resource($this->result_id))
		{
			sqlsrv_free_stmt($this->result_id);
			$this->result_id = FALSE;
		}
	}
1324346
public function exec() {
        try {
            $query = $this->db->prepare($this->q->get());
            $this->bindValues($query);
            $query->execute();

            // Set the last inserted id but only
            // of $this->db->lastInsertId() is not empty
            if (!empty($this->db->lastInsertId())) {
                $this->lastInsertId = $this->db->lastInsertId();
            }

            $this->clear();

            return true;
        } catch (\PDOException $e) {
            $this->setError('d', $e->getMessage());
            return false;
        }
    }
56105
public function bind($bind, $password)
    {
        $this->_setErrorHandler();
        $result = ldap_bind($this->getConnection(), $bind, $password);
        $this->_unsetErrorHandler();

        return $result;
    }
1088994
public function statement($query, $bindings = array(), $rawResults = false)
    {
        return $this->run($query, $bindings, function(self $me, $query, array $bindings) use($rawResults)
        {
            if ($me->pretending()) return true;

            $statement = $me->getCypherQuery($query, $bindings);

            $result = $statement->getResultSet();

            return ($rawResults === true) ? $result : $result instanceof ResultSet;
        });
    }
1099753
function addCurrentResult()
    {
        if ( is_array( $this->CurrentResult ) )
            $this->Results[] = $this->CurrentResult;
        return $this->CurrentResult;
    }
599575
public function exec(): bool
    {
        /* @var $sqlStmt \PDOStatement */
        $sqlStmt = $this->getConnection()->prepare($this->getQuery());

        if ($sqlStmt === false) {
            return $this->execFails($sqlStmt, ErrorType::CONNECTION_ERROR);
        }

        // Bind input
        foreach ($this->bindedValues as /* @var $i int */
                 $i => $bindedValue) {
            $type = $this->getPDOType($bindedValue);

            if ($type === false) {
                throw new \Exception('Invalid type of binded value at position ' . ($i + 1) . '.');
            }

            $bindParamsResult = $sqlStmt->bindValue($i + 1, $bindedValue, $type);

            if ($bindParamsResult === false) {
                return $this->execFails($sqlStmt, ErrorType::BINDING_ERROR);
            }
        }

        // Exec query
        $result = $sqlStmt->execute();

        if ($result == false) {
            return $this->execFails($sqlStmt, ErrorType::STATEMENT_ERROR);
        }

        $this->result = new MPDOResult($sqlStmt);

        $sqlStmt->closeCursor();

        return true;
    }
627869
private function _checkBinds()
    {
        if ($this->_fetch_sty!=\PDO::FETCH_BOUND) {
            return;
        }
        foreach ($this->_binds as $key => &$value) {
            if (is_numeric($key)) {
                $key --;
            } else {
                $key = strtoupper($key);
            }
            if (!array_key_exists($key, $this->_current)) {
                continue;
            }
            $value = $this->_current[$key];
        }
    }
471595
public function setResult($jobname, $result = null)
    {
        if (isset($this->results[$jobname])) {
            return false;
        }
        $this->results[$jobname] = $result;
        ++$this->resultsNum;
        $this->checkIfAllReady();
        return true;
    }
1210011
public function bindValues($values): void
    {
        $params = func_get_args();
        if (isset($params[0]) && is_array($params[0])) {
            $this->bindedValues = new \ArrayObject($params[0]);
        } else {
            $this->bindedValues = new \ArrayObject($params);
        }
    }
143135
public function getResults()
    {
        if (is_null($this->_resultsCache)) {
            $this->_resultsCache = call_user_func($this->getMapper());

            if ($this->prefetchRelatedLookups && !$this->_prefetchRelatedDone) {
                $this->_prefetchRelatedObjects();
            }
        }

        return $this->_resultsCache;
    }
1214402
protected function bind()
    {
        if (!isset($this->di)) {
            return false;
        }
        foreach ($this->di as $contract => $object) {
            $this->app->bind($contract, $object);
        }
    }