コード例 #1
0
 protected function getFiles()
 {
     $value = $this->model[$this->attribute] ?: [];
     if (empty($value)) {
         return [];
     }
     if (is_string($value)) {
         $value = StringHelper::explode($value);
     }
     $value = $this->multiple ? $value : [$value[0]];
     return array_map(function ($fileModel) {
         /** @var File $fileModel */
         return $fileModel->getExtendedAttributes();
     }, File::findAll($value));
 }