/**
  * get single Berichten instance from a DOMElement
  *
  * @param DOMElement $node
  * @return Berichten
  */
 public static function fromDOMElement(DOMElement $node)
 {
     $o = new Berichten();
     $o->assignByHash(self::domNodeToHash($node, self::$FIELD_NAMES, self::$DEFAULT_VALUES, self::$FIELD_TYPES));
     $o->notifyPristine();
     return $o;
 }
 /**
  * Fetch Berichten which references this BerichtenTo. Will return null in case reference is invalid.
  * `berichten_to`.`bericht` -> `berichten`.`id`
  *
  * @param PDO $db a PDO Database instance
  * @param array $sort array of DSC instances
  * @return Berichten
  */
 public function fetchBerichten(PDO $db, $sort = null)
 {
     $filter = array(Berichten::FIELD_ID => $this->getBericht());
     $result = Berichten::findByFilter($db, $filter, true, $sort);
     return empty($result) ? null : $result[0];
 }
Example #3
0
 /**
  * Fetch Berichten's which this Patient references.
  * `patient`.`code` -> `berichten`.`patient`
  *
  * @param PDO $db a PDO Database instance
  * @param array $sort array of DSC instances
  * @return Berichten[]
  */
 public function fetchBerichtenCollection(PDO $db, $sort = null)
 {
     $filter = array(Berichten::FIELD_PATIENT => $this->getCode());
     return Berichten::findByFilter($db, $filter, true, $sort);
 }