Beispiel #1
0
 public static function getCommentList(Phlickr_Api $api, $photo_id)
 {
     $request = $api->createRequest(self::XML_METHOD_NAME, array("photo_id" => $photo_id));
     if (is_null($request)) {
         throw new Phlickr_Exception('Could not create a Request flickr.photos.comments.getList.');
     } else {
         return new Phlickr_CommentList($request);
     }
 }
 /**
  * Constructor
  *
  * The PhotosetList requires a User Id. If $userId is null the class will
  * try to use the $api->getUserId().
  *
  * @param   object Phlickr_API $api
  * @param   string $userId User Id. If this isn't provided, the API's User
  *          Id will be used instead.
  * @throws  Phlickr_Exception
  */
 function __construct(Phlickr_Api $api, $userId = null)
 {
     if (isset($userId)) {
         $this->_userId = $userId;
     } else {
         $this->_userId = $api->getUserId();
     }
     if (is_null($this->_userId)) {
         throw new Phlickr_Exception('The photoset needs a User Id.');
     }
     parent::__construct($api->createRequest(self::getRequestMethodName(), self::getRequestMethodParams($this->_userId)), self::XML_RESPONSE_ELEMENT, self::XML_RESPONSE_LIST_ELEMENT);
 }
Beispiel #3
0
 /**
  * Create a Phlickr_Request object that will request the XML for this object.
  *
  * @param   object Phlickr_Api $api
  * @param   mixed string $id
  * @return  object Phlickr_Request
  * @see     __construct()
  */
 protected function &createRequest(Phlickr_Api $api, $id)
 {
     $request = $api->createRequest($this->getRequestMethodName(), $this->getRequestMethodParams($id));
     if (is_null($request)) {
         throw new Phlickr_Exception('Could not create a Request.');
     } else {
         return $request;
     }
 }