*
Get all media for the given type.
public getByModelType ( string $modelType ) : Illuminate\Database\Eloquent\Collection | ||
$modelType | string | |
return | Illuminate\Database\Eloquent\Collection |
public function getMediaToBeRegenerated() { if ($this->argument('modelType') == '') { return $this->mediaRepository->all(); } return $this->mediaRepository->getByModelType($this->argument('modelType')); }
public function getMediaItems() : Collection { $modelType = $this->argument('modelType'); $collectionName = $this->argument('collectionName'); if (!is_null($modelType) && !is_null($collectionName)) { return $this->mediaRepository->getByModelTypeAndCollectionName($modelType, $collectionName); } if (!is_null($modelType)) { return $this->mediaRepository->getByModelType($modelType); } if (!is_null($collectionName)) { return $this->mediaRepository->getByCollectionName($collectionName); } return $this->mediaRepository->all(); }
public function getMediaToBeRegenerated() : Collection { $modelType = $this->argument('modelType') ?? ''; $mediaIds = $this->option('ids'); if ($modelType === '' && !$mediaIds) { return $this->mediaRepository->all(); } if ($mediaIds) { if (!is_array($mediaIds)) { $mediaIds = explode(',', $mediaIds); } return $this->mediaRepository->getByIds($mediaIds); } return $this->mediaRepository->getByModelType($modelType); }