示例#1
0
 /**
  * Restores some state that can not be serialized/unserialized.
  *
  * @param ReflectionService $reflService
  */
 public function wakeupReflection(ReflectionService $reflService)
 {
     $this->reflClass = $reflService->getClass($this->name);
     $this->namespace = $reflService->getClassNamespace($this->name);
     $fieldNames = array_merge($this->getFieldNames(), $this->getAssociationNames());
     foreach ($fieldNames as $fieldName) {
         $reflField = isset($this->mappings[$fieldName]['declared']) ? new ReflectionProperty($this->mappings[$fieldName]['declared'], $fieldName) : $this->reflClass->getProperty($fieldName);
         $reflField->setAccessible(true);
         $this->reflFields[$fieldName] = $reflField;
     }
 }
 /**
  * Initializes a new ClassMetadata instance that will hold the object-relational mapping
  * metadata of the class with the given name.
  *
  * @param \Doctrine\Common\Persistence\Mapping\ReflectionService $reflService The reflection service.
  */
 public function initializeReflection($reflService)
 {
     $this->reflClass = $reflService->getClass($this->name);
     $this->namespace = $reflService->getClassNamespace($this->name);
     if ($this->reflClass) {
         $this->name = $this->rootEntityName = $this->reflClass->getName();
     }
     $this->table['name'] = $this->namingStrategy->classToTableName($this->name);
 }
示例#3
0
 /**
  * Initializes a new ClassMetadata instance that will hold the object-relational mapping
  * metadata of the class with the given name.
  *
  * @param \Doctrine\Common\Persistence\Mapping\ReflectionService $reflService The reflection service.
  *
  * @return void
  */
 public function initializeReflection($reflService)
 {
     $this->reflClass = $reflService->getClass($this->name);
     $this->namespace = $reflService->getClassNamespace($this->name);
     if ($this->reflClass) {
         $this->name = $this->rootDocumentName = $this->reflClass->getName();
     }
 }
 /**
  * Initializes a new ClassMetadata instance that will hold the object-relational mapping
  * metadata of the class with the given name.
  *
  * @param \Doctrine\Common\Persistence\Mapping\ReflectionService $reflService The reflection service.
  */
 public function initializeReflection($reflService)
 {
     $this->reflClass = $reflService->getClass($this->name);
     $this->namespace = $reflService->getClassNamespace($this->name);
     $this->xmlName = Inflector::xmlize($this->reflClass->getShortName());
     if ($this->reflClass) {
         $this->name = $this->rootXmlEntityName = $this->reflClass->getName();
     }
 }
示例#5
0
 /**
  * Initializes a new ClassMetadata instance that will hold the
  * object-relational mapping metadata of the class with the given name.
  *
  * @param ReflectionService $reflService
  */
 public function initializeReflection(ReflectionService $reflService)
 {
     $this->reflClass = $reflService->getClass($this->name);
     $this->namespace = $reflService->getClassNamespace($this->name);
 }
示例#6
0
 /**
  * Restores some state that can not be serialized/unserialized.
  *
  * @param ReflectionService $reflService
  */
 public function wakeupReflection(ReflectionService $reflService)
 {
     $this->reflClass = $reflService->getClass($this->name);
     $this->namespace = $reflService->getClassNamespace($this->name);
     foreach ($this->fieldMappings as $field => $mapping) {
         if (isset($mapping['declared'])) {
             $reflField = new ReflectionProperty($mapping['declared'], $field);
         } else {
             $reflField = $this->reflClass->getProperty($field);
         }
         $reflField->setAccessible(true);
         $this->reflFields[$field] = $reflField;
     }
     foreach ($this->fieldMappings as $field => $mapping) {
         if (isset($mapping['declared'])) {
             $reflField = new ReflectionProperty($mapping['declared'], $field);
         } else {
             $reflField = $this->reflClass->getProperty($field);
         }
         $reflField->setAccessible(true);
         $this->reflFields[$field] = $reflField;
     }
 }