22 public function init(): void
24 $query = Avatar\Model\ItemTable::query()
26 '=OWNER_TYPE' => Avatar\Mask\Owner\User::class,
27 '=OWNER_ID' => $this->entityId
29 ->setSelect([
'ID',
'FILE_ID',
'TITLE',
'DESCRIPTION',
'SORT'])
30 ->setOrder([
'ID' =>
'ASC'])
31 ->setLimit(static::PAGE_SIZE)
32 ->setOffset($this->stepNumber * static::PAGE_SIZE)
35 while ($res = $query->fetch())
38 $this->files[] = [
'ID' => $res[
'FILE_ID']];
40 if ($this->data->count() >= static::PAGE_SIZE)
42 $this->nextStep->set(
'last', $this->data->current());