protected function _afterEntityDelete(AnCommandContext $context)
    {
        if (!empty($this->__sets)) {
            foreach ($this->__sets as $set) {
                if ($set->photos->getTotal() == 0) {
                    $set->delete();
                }
            }
        }
    }
protected function _afterEntityDelete(AnCommandContext $context)
    {
        if (!empty($this->__sets)) {
            foreach ($this->__sets as $set) {
                if ($set->photos->getTotal() == 0) {
                    $set->delete();
                }
            }
        }
    }
protected function _afterEntityDelete ( AnCommandContext $ context ) { if ( ! empty ( $ this -> __sets ) ) { foreach ( $ this -> __sets as $ set ) { if ( $ set -> photos -> getTotal ( ) == 0 ) { $ set -> delete ( ) ; } } } }
Delete the photo from all the sets.

AnCommandContext $context Context
Delete the photo from all the sets .