/** * Create a new object instance from a wiki site key. * * @access public * @param string Wiki Site Key * @return mixed bool|Site Object */ public static function newFromSite($siteKey) { if (strlen($siteKey) != 32 && $siteKey != 'master') { return false; } $grl = new self(); $grl->setSite($siteKey); return $grl; }
public static function create(array $data) { $is = false; $contact = new self(); if (isset($data['email'])) { $contact->setEmail($data['email']); $is = true; } if (isset($data['phones'])) { $contact->setPhones($data['phones']); $is = true; } if (isset($data['email'])) { $contact->setEmail($data['email']); $is = true; } if (isset($data['site'])) { $contact->setSite($data['site']); $is = true; } if (isset($data['facebook'])) { $contact->setFacebook($data['facebook']); $is = true; } if ($is == false) { return null; } return $contact; }