/** * Get a copy of the actual record before we delete it to have it present in afterDelete * * @param boolean $cascade * @return boolean */ public function beforeDelete($cascade = true) { if (!parent::beforeDelete($cascade)) { return false; } $Event = new CakeEvent('VideoStorage.beforeDelete', $this, array('record' => $this->record, 'storage' => $this->getStorageAdapter($this->record[$this->alias]['adapter']))); $this->getEventManager()->dispatch($Event); if ($Event->isStopped()) { return false; } return true; }