Api

Version

mediamosa-30

Class

mediamosa_rest_call_list

Code

File: /sites/all/modules/mediamosa/rest/mediamosa_rest.rest.class.inc
<?php?php
// $Id$

/**
 * MediaMosa is Open Source Software to build a Full Featured, Webservice
 * Oriented Media Management and Distribution platform (http://mediamosa.org)
 *
 * Copyright (C) 2011 SURFnet BV (http://www.surfnet.nl) and Kennisnet
 * (http://www.kennisnet.nl)
 *
 * MediaMosa is based on the open source Drupal platform and
 * was originally developed by Madcap BV (http://www.madcap.nl)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, you can find it at:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */

 /**
  * @file
  * The REST calls of the REST interface.
  */

/**
 * URI: /rest
 * Rest calls for/of rest interface.
 */
class mediamosa_rest_call_list extends mediamosa_rest_call {

  public function 
get_var_setup() {
    
$var_setup = array(
      
mediamosa_rest_call::VARS => array(),
    );

    
// Enrich with default REST vars limit / offset.
    
$var_setup self::get_var_setup_range($var_setup);

    
// Enrich with required REST vars.
    
return self::get_var_setup_default($var_setupFALSE);
  }

  public function 
do_call() {
    
$mediamosa mediamosa::get();

    
$limit $this->get_param_value(mediamosa_rest_call::LIMIT);
    
$offset $this->get_param_value(mediamosa_rest_call::OFFSET);

    
// Get all rest calls.
    
$calls mediamosa_rest::get_rest_calls($limit$offset, array('restrict_interface' => FALSE));

    foreach (
$calls as $call_method) { // Method
      
foreach ($call_method as $call_uri) { // Uri
        
$mediamosa->add_item($call_uri);
      }
    }
  }
}