public function getFilesAggregation() {
return $this->getFiles()
->alias('f')
->select(['isCompleted' => 'count(f.id) > 0'])
->groupBy('f.id')
->having('count(f.id) > 0')
->asArray();
}
public function getIsCompleted() {
return $this->isNewRecord ? false : (bool)$this->filesAggregation[0]['isCompleted'];
}
$article->getPayments()->joinWith('filesAggregation');
public class GenericArray<T, S>: IEnumerable where T: ItemGenericArray<S>
ienumerable здесь подключенный интерфейс или ограничение?
$matching = [ 1 => 'admin', 2 => 'editor', 3 => 'user' ];
echo $matching[$role];