entity = $entity; if (!is_int($direction)) { throw new InvalidArgumentException('$direction must be an integer'); } $this->direction = $direction; } public function __toString () { return 'PTLine[' . $this->entity . '/' . $this->ref . '/' . $this->direction . ']'; } public function getRef () { return $this->ref; } public function getPublicRef () { if (!$this->infoFetched) $this->fetchInfo(); return $this->publicRef; } public function getLineType () { if (!$this->infoFetched) $this->fetchInfo(); return $this->lineType; } public function getDirectionDesc () { if (!$this->infoFetched) $this->fetchInfo(); return $this->directionDesc; } protected function fetchInfo () { $apireq = new ApiCoreRequest('lijnen/titel/' . $this->entity . '/' . $this->ref . '/' . $this->direction); $response = $apireq->exec(); $this->lineType = PTElement::lineTypeTextToConst($response['lijnType']); $this->publicRef = $response['lijnNummerPubliek']; $this->directionDesc = $response['lijnRichting']; } public function getTimetable () { throw new NotImplementedException(); } public function getTimetableAtStop (PTStop $stop) { throw new NotImplementedException(); } public static function htmlElement($bgColor, $bgBorder, $fgColor, $lineNumber, $class='') { return '' .$lineNumber . ''; } } ?>