for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) Flipbox Digital Limited
* @license https://flipboxfactory.com/software/patron/license
* @link https://www.flipboxfactory.com/software/patron/
*/
namespace flipbox\patron\db;
use craft\db\QueryAbortedException;
use flipbox\ember\db\traits\AuditAttributes;
use flipbox\ember\db\traits\FixedOrderBy;
use flipbox\patron\Patron;
use yii\db\ActiveQuery;
* @author Flipbox Factory <[email protected]>
* @since 1.0.0
class ProviderActiveQuery extends ActiveQuery
{
use traits\ProviderAttributes,
FixedOrderBy,
AuditAttributes;
* @inheritdoc
public function init()
parent::init();
if ($this->environment === null) {
$this->environment = Patron::getInstance()->getSettings()->getEnvironment();
}
public $orderBy = ['dateCreated' => SORT_DESC];
/*******************************************
* FIXED ORDER
*******************************************/
protected function fixedOrderColumn(): string
return 'id';
* PREPARE
*
* @throws QueryAbortedException if it can be determined that there won’t be any results
public function prepare($builder)
$this->applyConditions();
$this->applyAuditAttributeConditions();
$this->applyOrderByParams($builder->db);
return parent::prepare($builder);