PageRenderTime 17ms CodeModel.GetById 9ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/plugin/PBAPI/PBAPI/Methods/user.php

https://bitbucket.org/chamilo/chamilo-ext-repo-photobucket-dev/
PHP | 114 lines | 51 code | 10 blank | 53 comment | 7 complexity | 808be89fcee202c360d3d06225beb5d3 MD5 | raw file
  1<?php
  2use common\libraries\Path;
  3/**
  4 * Photobucket API 
  5 * Fluent interface for PHP5
  6 * User methods
  7 * 
  8 * @author Photobucket
  9 * @package PBAPI
 10 * @subpackage Methods
 11 * 
 12 * @copyright Copyright Copyright (c) 2008, Photobucket, Inc.
 13 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
 14 */
 15
 16/**
 17 * Load Methods parent
 18 */
 19require_once dirname(__FILE__) . '/../Methods.php';
 20
 21/**
 22 * User Methods
 23 *
 24 * @package PBAPI
 25 * @subpackage Methods
 26 */
 27class PBAPI_Methods_user extends PBAPI_Methods
 28{
 29
 30    /**
 31     * search
 32     *
 33     * @param array $params
 34     */
 35    public function search($term = null, $params = null)
 36    {
 37        $this->core->_setParamList($params);
 38        if ($term)
 39        {
 40            $this->core->_appendUri('/search/' . $term);
 41        }
 42        else
 43        {
 44            $this->core->_appendUri('/search');
 45        }
 46    
 47    }
 48
 49    /**
 50     * URLs
 51     *
 52     * @param array $params
 53     */
 54    public function url($params = null)
 55    {
 56        $this->core->_appendUri('/url');
 57    }
 58
 59    /**
 60     * Contacts
 61     *
 62     * @param array $params
 63     */
 64    public function contact($params = null)
 65    {
 66        $this->core->_appendUri('/contact');
 67    }
 68
 69    /**
 70     * upload options
 71     *
 72     * @param array $params
 73     */
 74    public function uploadoption($params = null)
 75    {
 76        $this->core->_setParamList($params);
 77        $this->core->_appendUri('/uploadoption');
 78    }
 79
 80    /**
 81     * get Tags for a user
 82     *
 83     * @param string $tagname name of a single tag to get media for
 84     * @param array $params
 85     */
 86    public function tag($tagname = '', $params = null)
 87    {
 88        if (is_array($tagname) && $params == null)
 89        {
 90            $params = $tagname;
 91            $tagname = '';
 92        }
 93        $this->core->_appendUri('/tag/%s', $tagname);
 94        $this->core->_setParamList($params);
 95    }
 96
 97    /**
 98     * get Favorites for a user
 99     *
100     * @param int $favid id of a single favorite
101     * @param array $params
102     */
103    public function favorite($favid = '', $params = null)
104    {
105        if (is_array($favid) && $params == null)
106        {
107            $params = $favid;
108            $favid = '';
109        }
110        $this->core->_appendUri('/favorite/%s', $favid);
111        $this->core->_setParamList($params);
112    }
113
114}