public getData ( string $query, callable $callback = null, array $params = [] ) : array | ||
$query | string | The query being passed. |
$callback | callable | Optionally, the name of a function to call back to on each row |
$params | array | Query params. E.g. [1, 'steve'] or [':id' => 1, ':name' => 'steve'] |
return | array | An array of database result objects or callback function results. If the query returned nothing, an empty array. |
public function getData($query, $callback = null, array $params = [])
{
return $this->getResults($query, $callback, false, $params);
}
/** * Get all the relationships for a given GUID. * * @param int $guid GUID of the subject or target entity (see $inverse) * @param bool $inverse_relationship Is $guid the target of the deleted relationships? By default $guid is * the subject of the relationships. * * @return \ElggRelationship[] */ public function getAll($guid, $inverse_relationship = false) { $guid = (int) $guid; $where = $inverse_relationship ? "guid_two='{$guid}'" : "guid_one='{$guid}'"; $query = "SELECT * from {$this->db->getTablePrefix()}entity_relationships WHERE {$where}"; return $this->db->getData($query, array($this, 'rowToElggRelationship')); }