/** * PathsAnswer constructor. * @param NodeEntity $from * @param NodeEntity $to * @param PathEntity[] $pathEntities */ public function __construct(NodeEntity $from, NodeEntity $to, array $pathEntities) { parent::__construct($from, $to); $this->pathEntities = $pathEntities; $this->paths = $this->processPaths($pathEntities); }
/** * PathsAnswer constructor. * @param NodeEntity $from * @param NodeEntity $to * @param PathEntity $pathEntity */ public function __construct(NodeEntity $from, NodeEntity $to, PathEntity $pathEntity = null) { parent::__construct($from, $to); $this->pathEntity = $pathEntity; $this->path = $pathEntity ? $pathEntity->getPath()->getData() : false; }