コード例 #1
0
ファイル: delete.php プロジェクト: dmitriz/Platform
/**
 * Removes a contact from the system.
 * @param {array} $_REQUEST
 * @param {string} $_REQUEST.label The label of the contact
 * @param {string} $_REQUEST.contactUserId The contactUserId of the contact
 * @param {string} [$_REQUEST.userId=Users::loggedInUser(true)->id] You can override the user id, if another plugin adds a hook that allows you to do this
 */
function Users_contact_delete($params = array())
{
    $req = array_merge($_REQUEST, $params);
    Q_Request::requireFields(array('label', 'contactUserId'), $req, true);
    $loggedInUserId = Users::loggedInUser(true)->id;
    $userId = Q::ifset($req, 'userId', $loggedInUserId);
    $label = $req['label'];
    $contactUserId = $req['contactUserId'];
    return !!Users_Contact::removeContact($userId, $label, $contactUserId);
}
コード例 #2
0
ファイル: User.php プロジェクト: dmitriz/Platform
 /**
  * @method removeContact
  * @param {string|array} $label
  *  The label of the contact. 
  * @param {string} $contactUserId
  *  The id of the user who is the contact
  * @param {string} [$asUserId=null]
  *  The id of the user who is the contact
  * @return {Db_Mysql}
  */
 function removeContact($label, $contactUserId, $asUserId = null)
 {
     Users_Contact::removeContact($this->id, $label, $contactUserId, $asUserId);
 }