nineinchnick\nfy\components\DbQueue::getSubscriptions PHP Method

getSubscriptions() public method

public getSubscriptions ( mixed $subscriber_id = null ) : array | nineinchnick\nfy\models\DbSubscription
$subscriber_id mixed
return array | nineinchnick\nfy\models\DbSubscription
    public function getSubscriptions($subscriber_id = null)
    {
        /** @var $query \yii\db\ActiveQuery */
        $query = models\DbSubscription::find()->current()->withQueue($this->id)->with(['categories']);
        if ($subscriber_id !== null) {
            $dbSubscriptions = $query->andWhere('subscriber_id=:subscriber_id', [':subscriber_id' => $subscriber_id]);
        }
        $dbSubscriptions = $query->all();
        return models\DbSubscription::createSubscriptions($dbSubscriptions);
    }