/** * The constructor. Creates a seminar instance from a DB record. * * By default, the process of creating a seminar object from a hidden record * fails. If we need the seminar object although it's hidden, the parameter * $allowHiddenRecords should be set to TRUE. * * @param int $uid UID of the seminar to retrieve from the DB. This parameter will be ignored if $dbResult is provided. * @param resource|boolean $dbResult MySQL result pointer (of SELECT query). If this parameter is provided, $uid will be ignored. * @param bool $allowHiddenRecords whether it is possible to create a seminar object from a hidden record */ public function __construct($uid, $dbResult = FALSE, $allowHiddenRecords = FALSE) { parent::__construct($uid, $dbResult, $allowHiddenRecords); // For date records: Create a reference to the topic record. if ($this->isEventDate()) { $this->topic = $this->retrieveTopic(); // To avoid infinite loops, null out $this->topic if it is a date // record, too. Date records that fail the check isTopicOkay() // are used as a complete event record. if ($this->isTopicOkay() && $this->topic->isEventDate()) { $this->topic = NULL; } } else { $this->topic = NULL; } }