示例#1
0
 private function canDelete(Photo $photo, User $user = null)
 {
     if ($photo->getAuthor() == $user) {
         return true;
     }
     if ($photo->getAlbum()->getAuthors()->contains($user)) {
         return true;
     }
     return false;
 }