Пример #1
0
 /**
  * Constructor. $subject is the SMWExpResource for the
  * subject about which this SMWExpData is.
  */
 public function __construct(SMWExpResource $subject)
 {
     parent::__construct($subject->getDataItem());
     $this->m_subject = $subject;
 }
Пример #2
0
 /**
  * Constructor. The given lexical form should be the plain string for
  * representing the literal without datatype or language information.
  * It must not use any escaping or abbreviation mechanisms.
  *
  * @param string $lexicalForm lexical form
  * @param string $datatype Data type URI or empty for untyped literals
  * @param SMWDataItem|null $dataItem
  *
  * @throws InvalidArgumentException
  */
 public function __construct($lexicalForm, $datatype = '', SMWDataItem $dataItem = null)
 {
     if (!is_string($lexicalForm)) {
         throw new InvalidArgumentException('$lexicalForm needs to be a string');
     }
     if (!is_string($datatype)) {
         throw new InvalidArgumentException('$datatype needs to be a string');
     }
     parent::__construct($dataItem);
     $this->lexicalForm = $lexicalForm;
     $this->datatype = $datatype;
 }
Пример #3
0
 /**
  * Constructor. The given lexical form should be the plain string for
  * representing the literal without datatype or language information.
  * It must not use any escaping or abbrevition mechanisms.
  *
  * @param $lexicalForm string lexical form
  * @param $datatype string datatype URI or empty for untyped literals
  * @param $dataItem SMWDataItem or null
  */
 public function __construct($lexicalForm, $datatype = '', $dataItem = null)
 {
     parent::__construct($dataItem);
     $this->m_lexicalForm = $lexicalForm;
     $this->m_datatype = $datatype;
 }