public function preDelete()
    {
        $attId = $this->id();
        $joinProto = $this->modelFactory()->get(Join::class);
        $loader = $this->collectionLoader();
        $loader->setModel($joinProto);

        $collection = $loader->addFilter('attachment_id', $attId)->load();

        foreach ($collection as $obj) {
            $obj->delete();
        }

        return parent::preDelete();
    }
public function preDelete()
    {
        $attId = $this->id();
        $joinProto = $this->modelFactory()->get(Join::class);
        $loader = $this->collectionLoader();
        $loader->setModel($joinProto);

        $collection = $loader->addFilter('attachment_id', $attId)->load();

        foreach ($collection as $obj) {
            $obj->delete();
        }

        return parent::preDelete();
    }
public function preDelete ( ) { $ attId = $ this -> id ( ) ; $ joinProto = $ this -> modelFactory ( ) -> get ( Join :: class ) ; $ loader = $ this -> collectionLoader ( ) ; $ loader -> setModel ( $ joinProto ) ; $ collection = $ loader -> addFilter ( 'attachment_id' , $ attId ) -> load ( ) ; foreach ( $ collection as $ obj ) { $ obj -> delete ( ) ; } return parent :: preDelete ( ) ; }
Event called before _deleting_ the attachment.

@see    Charcoal\Source\StorableTrait::preDelete() For the "create" Event.
@see    Charcoal\Attachment\Traits\AttachmentAwareTrait::removeJoins
@return boolean
Event called before _deleting_ the attachment .