function hasWebpage($url, $web_type)
 {
     $type_id = WebpageTypes::getWebpageTypeId($web_type);
     $obj = ContactWebpages::instance()->findOne(array('conditions' => array('contact_id=? AND web_type_id=? AND url=?', $this->getId(), $type_id, $url)));
     return $obj instanceof ContactWebpage;
 }
Exemple #2
0
 /**
  * 
  * Add webpage to the contact
  * @param string $url
  * @param int $web_type
  * @author Seba
  */
 function addWebpage($url, $web_type)
 {
     $web = new ContactWebpage();
     $web->setUrl($url);
     $web->setWebTypeId(WebpageTypes::getWebpageTypeId($web_type));
     $web->setContactId($this->getId());
     $web->save();
 }