Exemplo n.º 1
0
 /**
  * @return null
  */
 protected function flushConstantWithScopeAndName(string $scope, string $name)
 {
     // Remove it from the database
     if (Database::isEnabled()) {
         ConstantModel::delete(Database::get(), $scope . '|' . $name);
     }
     // Remove it from memory
     unset($this->constant_map[$scope][$name]);
 }
Exemplo n.º 2
0
 /**
  * @param array
  * A map from column name to value
  *
  * @return Constant
  * An instance of the model derived from row data
  */
 public static function fromRow(array $row) : Constant
 {
     list($scope, $name) = explode('|', $row['scope_name']);
     $constant = new Constant(new ConstantElement(unserialize(base64_decode($row['context'])), $row['name'], UnionType::fromFullyQualifiedString($row['type']), (int) $row['flags']), $scope, $name);
     if (false !== strpos($row['fqsen'], '::')) {
         $fqsen = FullyQualifiedClassConstantName::fromFullyQualifiedString($row['fqsen']);
     } else {
         $fqsen = FullyQualifiedGlobalConstantName::fromFullyQualifiedString($row['fqsen']);
     }
     $constant->getConstant()->setFQSEN($fqsen);
     return $constant;
 }