Я создаю сайт.
Я кодирую серверную часть с помощью PHP и SQL на сервере WAMP.
В данный момент я пытаюсь создать базовые классы, на которых будут основываться другие классы.
Это диаграмма , которую я пытаюсь реализовать.
Мне также хотелось бы, чтобы некоторые свойства бизнес-объекта были установлены со значением из бизнес-словаря: ReferenceData.php (более поздние определения будут в конце в ReferenceData.xml). В следующем классе это делается в строке 24:
private $ role = $ classif_identifier;
, но эта строка неисправна во время выполнения
Неустранимая ошибка: выражение константы содержит недопустимые операции в C: \ Wampee-3.1.0-beta-3.4 \ www \ HTML_PHP_Training \ PHP OO \ Identifier.php в строке 24 *
Почему? Identification.php выглядит следующим образом:
<?php
include 'ReferenceData.php';
class Identifier
{
//idString [1] : IdentifierString: the alphanumeric string that represents an identifying name or code.
private $idString;
//role [1] : ClassSelect the classification that defines the role of the identification. The possible classifications are subclasses of http://docs.oasis-open.org/plcs/ns/plcslib/v1.0/data/plcs/plcs-psm/refdata/plcs-psm#Identifier
private $role = $classif_identifier;
/* Constraint: UR1
Specification: (OCL2.0)
Identifier::allInstances()->isUnique(Sequence{idString, role, identificationContext}) */
public function __construct($id)
{
$this->idString = $id;
}
public function get_idString()
{
return $this->idString;
}
public function set_idString($id)
{
$this->idString = $id;
}
public function get_role()
{
return $this->role;
}
public function set_role($role)
{
$this->role = $role;
}
}
?>
И $ classif_identifier определен как ReferenceData.php, который выглядит так:
<?php
/* Class URI: http://docs.oasis-open.org/plcs/ns/plcslib/v1.0/data/plcs/plcs-psm/refdata/plcs-psm#Identifier
Class label: identifier
Definition:
name or code that is used to label something and to refer to that thing */
$classif_identifier='http://docs.oasis-open.org/plcs/ns/plcslib/v1.0/data/plcs/plcs-psm/refdata/plcs-psm#Identifier';
?>
Оба файла находятся в одной папке.
Вы знаете, как это сделать? В чем дело?
Спасибо за чтение.
Самуил