Esempio n. 1
0
 /**
  * Get the bookmark that a user made for an URL
  *
  * @param Profile $profile Profile to check for
  * @param string  $url     URL to check for
  *
  * @return Bookmark bookmark found or null
  */
 static function getByURL($profile, $url)
 {
     $nb = new Bookmark();
     $nb->profile_id = $profile->id;
     $nb->url = $url;
     if ($nb->find(true)) {
         return $nb;
     } else {
         return null;
     }
 }
Esempio n. 2
0
 /**
  * Get the bookmark that a user made for an URL
  *
  * @param Profile $profile Profile to check for
  * @param string  $url     URL to check for
  *
  * @return Bookmark bookmark found or null
  */
 static function getByURL(Profile $profile, $url)
 {
     $nb = new Bookmark();
     $nb->profile_id = $profile->getID();
     $nb->url = $url;
     if (!$nb->find(true)) {
         throw new NoResultException($nb);
     }
     return $nb;
 }