public function unBindAll($fileableId) { $model = $this->createModel(); $files = $model::getByFileable($fileableId); foreach ($files as $file) { $this->unBind($fileableId, $file, true); } }
/** * Set site representative image * * @param Image $image image instance * @return void */ public function setSiteImage(Image $image) { $this->storage->unBindAll($this->get('uuid')); $this->storage->bind($this->get('uuid'), $image); $this->image = $image; }