public __construct ( string $query, array $parameters = [], string $resultsQuery = null, array $resultsParameters = [] ) | ||
$query | string | The query to retrieve the data. |
$parameters | array | The parameters to be used inside the query. |
$resultsQuery | string | The optional count query, used to calculate the number of results. |
$resultsParameters | array | The parameters to be used inside the results query. |
/** * @param ContentBlock $contentBlock * @param Locale $locale */ public function __construct(ContentBlock $contentBlock, Locale $locale) { parent::__construct('SELECT i.id, i.revision_id, i.title, UNIX_TIMESTAMP(i.edited_on) AS edited_on, i.user_id FROM content_blocks AS i WHERE i.status = :archived AND i.id = :id AND i.language = :language ORDER BY i.edited_on DESC', ['archived' => ContentBlockStatus::archived(), 'language' => $locale, 'id' => $contentBlock->getId()]); }
/** * @param Locale $locale */ public function __construct(Locale $locale) { parent::__construct('SELECT i.id, i.title, i.hidden FROM content_blocks AS i WHERE i.status = :active AND i.language = :language', ['active' => ContentBlockStatus::active(), 'language' => $locale]); }