Skip to content

Commit

Permalink
Make StationBoardJourney standalone for compability
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian committed Jun 25, 2024
1 parent 7fe2b5a commit e69b2ed
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Transport/Entity/Schedule/Journey.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Journey
*/
public $capacity2nd = null;

public static function createFromXml(\SimpleXMLElement $xml, \DateTime $date, self $obj = null)
public static function createFromXml(\SimpleXMLElement $xml, \DateTime $date, $obj = null)
{
if (!$obj) {
$obj = new self();
Expand Down Expand Up @@ -161,7 +161,7 @@ public static function createFromXml(\SimpleXMLElement $xml, \DateTime $date, se
return $obj;
}

public static function createFromJson($json, self $obj = null)
public static function createFromJson($json, $obj = null)
{
if (!$obj) {
$obj = new self();
Expand Down
80 changes: 79 additions & 1 deletion lib/Transport/Entity/Schedule/StationBoardJourney.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,92 @@
*
* @SWG\Definition()
*/
class StationBoardJourney extends Journey
class StationBoardJourney
{
/**
* @var \Transport\Entity\Schedule\Stop
* @SWG\Property()
*/
public $stop;

/**
* The name of the connection (e.g. 019351).
*
* @var string
* @SWG\Property()
*/
public $name;

/**
* The type of connection this is (e.g. S).
*
* @var string
* @SWG\Property()
*/
public $category;

/**
* @var string
* @SWG\Property()
*/
public $subcategory;

/**
* An internal category code, indicates the type of the public transport vehicle. Possible values are 0, 1, 2, 3, 5, 8: train; 4: ship; 6: bus; 7: cable car (aerial, big); 9: tram.
*
* @var int
* @SWG\Property()
*/
public $categoryCode;

/**
* The number of the connection's line (e.g. 13).
*
* @var string
* @SWG\Property()
*/
public $number;

/**
* The operator of the connection's line (e.g. BBA).
*
* @var string
* @SWG\Property()
*/
public $operator;

/**
* The final destination of this line (e.g. Aarau Rohr, Unterdorf).
*
* @var string
* @SWG\Property()
*/
public $to;

/**
* Checkpoints the train passed on the journey.
*
* @var \Transport\Entity\Schedule\Stop[]
* @SWG\Property()
*/
public $passList = [];

/**
* The maximum estimated occupation load of 1st class coaches (e.g. 1).
*
* @var int
* @SWG\Property()
*/
public $capacity1st = null;

/**
* The maximum estimated occupation load of 2nd class coaches (e.g. 2).
*
* @var int
* @SWG\Property()
*/
public $capacity2nd = null;

/**
* @param \SimpleXMLElement $xml
* @param \DateTime $date The date that will be assigned to this journey
Expand Down

0 comments on commit e69b2ed

Please sign in to comment.