You are here

models.inc in Services 6.3

These are the base interfaces for resource models.

File

servers/rest_server/includes/models.inc
View source
<?php

/**
 * @file
 *  These are the base interfaces for resource models.
 */

/**
 * Interface that should be implemented by feed models.
 */
interface ResourceFeedModel extends Iterator {

}

/**
 * Interface that must be implemented by items returned
 * by a ResourceFeedModel.
 */
interface ResourceFeedModelItem {
  public function getName();
  public function getDescription();
  public function getUrl();
  public function getCreated();

  /**
   * Gets a associative array containing extra properties for the item.
   *
   * @return array
   *  The extra properties of the item as an array
   */
  public function getProperties();

}

/**
 * Interface that should be implemented by time feed models.
 */
interface ResourceTimeFeedModel extends ResourceFeedModel {

}

/**
 * Interface that must be implemented by items returned
 * by a ResourceTimeFeedModel.
 */
interface ResourceTimeFeedModelItem extends ResourceFeedModelItem {

  /**
   * Gets the starting time of the item
   *
   * @return int
   *  The starting time of the item as a timestamp
   */
  public function getStarts();

  /**
   * Gets the end time of the item
   *
   * @return int
   *  The end time of the item as a timestamp
   */
  public function getEnds();

}

Interfaces

Namesort descending Description
ResourceFeedModel Interface that should be implemented by feed models.
ResourceFeedModelItem Interface that must be implemented by items returned by a ResourceFeedModel.
ResourceTimeFeedModel Interface that should be implemented by time feed models.
ResourceTimeFeedModelItem Interface that must be implemented by items returned by a ResourceTimeFeedModel.