/** * As a primary resource (i.e. mapped to external resource) we need to ensure we have an id for tracking * the resource in the system. * * @return bool */ public function validate() { if (!$this->id) { $this->addError('Resource ID required'); } return parent::validate(); }
/** * As a primary resource (i.e. mapped to external resource) we need to ensure we have an id for tracking * the resource in the system. * * @return bool */ public function validate() { if (!$this->id) { $this->addError('Resource ID required'); } try { $this->resolvePatient(); } catch (\Exception $e) { $this->addError($e->getMessage()); } return parent::validate(); }
public function validate() { $mapping_keys = array(); if (isset($this->AppointmentMappingItems)) { foreach ($this->AppointmentMappingItems as $item) { if (in_array($item->Key, $mapping_keys)) { $this->addError("Duplicate key {$item->Key} is not allowed."); } } } return parent::validate(); }
/** * As a primary resource (i.e. mapped to external resource) we need to ensure we have an id for tracking * the resource in the system. * * @return bool */ public function validate() { $has_id = false; foreach ($this->id_tags as $attr) { if (isset($this->{$attr})) { $has_id = true; } } if (!$has_id) { $this->addError('At least one Id tag of the form ' . implode(',', $this->id_tags) . ' is required.'); } return parent::validate(); }
public function __construct($driver = false) { parent::__construct($driver); }
/** * Returns a peer instance associated with this om. * * Since Peer classes are not to have any instance attributes, this method returns the * same instance for all member of this class. The method could therefore * be static, but this would prevent one from overriding the behavior. * * @return ResourcePeer */ public function getPeer() { if (self::$peer === null) { self::$peer = new ResourcePeer(); } return self::$peer; }
public static function userinfo() { $response = BaseResource::sendRequest('GET', 'userinfo'); return $response->json(); }