public function TripalWebServiceCollection::addMember

3.x TripalWebServiceCollection.inc public TripalWebServiceCollection::addMember($member)

Adds a new member to this resource if it is a collection.

Parameters

$member: A TripalWebServiceResource member whose type is the same as this resource

File

tripal_ws/includes/TripalWebServiceCollection.inc, line 93

Class

TripalWebServiceCollection

Code

public function addMember($member) {
  // Make sure the $servcie provides is a TripalWebServcie class.
  if (!is_a($member, 'TripalWebServiceResource')) {
    throw new Exception("Cannot add a new member to this resource collection as it is not a TripalWebServiceResource.");
  }
  $this->members[] = $member;
}