示例#1
0
 /**
  * Takes an associative array and adds im.
  *
  * @param array $params
  *   (reference ) an assoc array of name/value pairs.
  *
  * @return object
  *   CRM_Core_BAO_Website object on success, null otherwise
  */
 public static function add(&$params)
 {
     $hook = empty($params['id']) ? 'create' : 'edit';
     CRM_Utils_Hook::pre($hook, 'Website', CRM_Utils_Array::value('id', $params), $params);
     $website = new CRM_Core_DAO_Website();
     $website->copyValues($params);
     $website->save();
     CRM_Utils_Hook::post($hook, 'Website', $website->id, $website);
     return $website;
 }
 /**
  * takes an associative array and adds im
  *
  * @param array  $params         (reference ) an assoc array of name/value pairs
  *
  * @return object       CRM_Core_BAO_Website object on success, null otherwise
  * @access public
  * @static
  */
 static function add(&$params)
 {
     $website = new CRM_Core_DAO_Website();
     $website->copyValues($params);
     return $website->save();
 }