Last active
November 2, 2015 15:14
-
-
Save damianoporta/298ccd4e67245debee1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Controlla se l'annuncio è di un determinato utente | |
* | |
* @param integer $adId Id annuncio | |
* @param integer $userId Id utente | |
* @return boolean L'annuncio è dell'utente? | |
*/ | |
public function hasOwner($adId, $userId) | |
{ | |
$n = $this->find() | |
->where([ | |
'Ads.id' => $adId, | |
'Ads.user_id' => $userId | |
]) | |
->count(); | |
return $n === 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment