/**
  * Check if the given object is a valid ApiObject for this collection, 
  * taking into account the model of the repository attached.
  * Returns the actual given object
  *
  * @throws InvalidRepositoryException
  * @param ApiObject $object
  * @return ApiObject $object
  */
 protected function validateObject(ApiObject $object)
 {
     if ($object->getModel() != $this->_repository->getModel()) {
         throw new InvalidRepositoryException();
     }
     return $object;
 }