lib/Accessible/Reader/AutoConstructReader.php
public static function getPropertiesToInitialize($properties, $annotationReader)
    {
        $propertiesValues = array();

        foreach ($properties as $propertyName => $property) {
            $initializeAnnotation = $annotationReader->getPropertyAnnotation($property, self::$initializeAnnotationClass);
            $initializeObjectAnnotation = $annotationReader->getPropertyAnnotation($property, self::$initializeObjectAnnotationClass);

            if ($initializeAnnotation !== null && $initializeObjectAnnotation !== null) {
                throw new \LogicException("Two initial values are given for property $propertyName.");
            }

            if ($initializeAnnotation !== null) {
                $propertiesValues[$propertyName] = array(
                    'type' => 'initialize',
                    'value' => $initializeAnnotation->getValue()
                );
            } else if ($initializeObjectAnnotation !== null) {
                $propertiesValues[$propertyName] = array(
                    'type' => 'initializeObject',
                    'value' => $initializeObjectAnnotation->getClassName()
                );
            }
        }

        return $propertiesValues;
    }
public static function getPropertiesToInitialize($properties, $annotationReader)
    {
        $propertiesValues = array();

        foreach ($properties as $propertyName => $property) {
            $initializeAnnotation = $annotationReader->getPropertyAnnotation($property, self::$initializeAnnotationClass);
            $initializeObjectAnnotation = $annotationReader->getPropertyAnnotation($property, self::$initializeObjectAnnotationClass);

            if ($initializeAnnotation !== null && $initializeObjectAnnotation !== null) {
                throw new \LogicException("Two initial values are given for property $propertyName.");
            }

            if ($initializeAnnotation !== null) {
                $propertiesValues[$propertyName] = array(
                    'type' => 'initialize',
                    'value' => $initializeAnnotation->getValue()
                );
            } else if ($initializeObjectAnnotation !== null) {
                $propertiesValues[$propertyName] = array(
                    'type' => 'initializeObject',
                    'value' => $initializeObjectAnnotation->getClassName()
                );
            }
        }

        return $propertiesValues;
    }
public static function getPropertiesToInitialize ( $ properties , $ annotationReader ) { $ propertiesValues = array ( ) ; foreach ( $ properties as $ propertyName => $ property ) { $ initializeAnnotation = $ annotationReader -> getPropertyAnnotation ( $ property , self :: $ initializeAnnotationClass ) ; $ initializeObjectAnnotation = $ annotationReader -> getPropertyAnnotation ( $ property , self :: $ initializeObjectAnnotationClass ) ; if ( $ initializeAnnotation !== null && $ initializeObjectAnnotation !== null ) { throw new \ LogicException ( "Two initial values are given for property $propertyName." ) ; } if ( $ initializeAnnotation !== null ) { $ propertiesValues [ $ propertyName ] = array ( 'type' => 'initialize' , 'value' => $ initializeAnnotation -> getValue ( ) ) ; } else if ( $ initializeObjectAnnotation !== null ) { $ propertiesValues [ $ propertyName ] = array ( 'type' => 'initializeObject' , 'value' => $ initializeObjectAnnotation -> getClassName ( ) ) ; } } return $ propertiesValues ; }
Get the list of properties that have to be initialized automatically
during the object construction, plus their value.

@param array  $properties The properties of the object to read.
@param \Doctrine\Common\Annotations\Reader $annotationReader The annotation reader to use.

@return array The list of properties and values,
in the form ["property" => "value"].
Get the list of properties that have to be initialized automatically during the object construction plus their value .