protected function _afterEntityDelete(AnCommandContext $context)
    {
        $total = $this->set->photos->reset()->getTotal();

        if ($total > 0) {
            $this->set->setValue('photo_count', $this->set->photos->reset()->getTotal());
        } else {
            $this->set->delete();
        }
    }