PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Friendship Methods

  • create() befriends the user specified in the id parameter with the authenticating user.

    Example 880. Creating friend

    <?php
    $twitter 
    = new Zend_Service_Twitter(array(
        
    'username' => 'johndoe',
        
    'accessToken' => $token
    ));
    $response   $twitter->friendship->create('mynewfriend');

  • destroy() discontinues friendship with the user specified in the id parameter and the authenticating user.

    Example 881. Deleting friend

    <?php
    $twitter 
    = new Zend_Service_Twitter(array(
        
    'username' => 'johndoe',
        
    'accessToken' => $token
    ));
    $response   $twitter->friendship->destroy('myoldfriend');

  • exists() tests if a friendship exists between the user specified in the id parameter and the authenticating user.

    Example 882. Checking friend existence

    <?php
    $twitter 
    = new Zend_Service_Twitter(array(
        
    'username' => 'johndoe',
        
    'accessToken' => $token
    ));
    $response   $twitter->friendship->exists('myfriend');

Zend Framework