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

Favorite Methods

  • favorites() returns the 20 most recent favorite statuses for the authenticating user or user specified by the id parameter.

    Example 883. Retrieving favorites

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

    The favorites() method accepts an array of optional parameters to modify the query.

    • id specifies the ID or screen name of the user for whom to request a list of favorite statuses.

    • page specifies which page you want to return.

  • create() favorites the status specified in the id parameter as the authenticating user.

    Example 884. Creating favorites

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

  • destroy() un-favorites the status specified in the id parameter as the authenticating user.

    Example 885. Deleting favorites

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

Zend Framework