/** * Bind Execute a query and fetch all rows as associative array * * @param string $query Query string * @param array $parameters Query parameters * @return array[] * @throws \Phramework\Exceptions\DatabaseException */ public static function bindExecuteAndFetchAll($query, $parameters = [], $castModel = null) { try { return static::$adapter->bindExecuteAndFetchAll($query, $parameters); } catch (\Exception $e) { throw new DatabaseException('Database Error', $e->getMessage()); } }
/** * Bind Execute a query and fetch all rows as associative array * * @param string $query Query string * @param array $parameters Query parameters * @param array $castModel [Optional] Default is null, if set then * \Phramework\Models\Filter::castEntry will be applied to data * @return array[] * @throws Phramework\Exceptions\DatabaseException */ public function bindExecuteAndFetchAll($query, $parameters = [], $castModel = null) { $startTimestamp = time(); $exception = null; try { $result = $this->internalAdapter->bindExecuteAndFetchAll($query, $parameters, $castModel); } catch (\Exception $e) { $exception = $e; } finally { //log $this->log($query, $parameters, $startTimestamp, $exception); if ($exception) { throw $exception; } } return $result; }