Example #1
0
    /**
     * Constructor
     *
     * @param ObjectManager $objectManager The ObjectManager to use
     * @param bool          $byValue       If set to true, hydrator will always use entity's public API
     */
    public function __construct(ObjectManager $objectManager, $byValue = true)
    {
        parent::__construct();

        $this->objectManager = $objectManager;
        $this->byValue       = (bool) $byValue;
    }
Example #2
0
 public function __construct($queryMap = null, $namespaces = null, $xpath = null)
 {
     parent::__construct();
     $this->setQueryMap($queryMap);
     $this->setNamespaces($namespaces);
     $this->setXPath($xpath);
 }
Example #3
0
 /**
  * Constructor
  *
  * @param ObjectManager $objectManager The ObjectManager to use
  * @param string        $targetClass   The FQCN of the hydrated/extracted object
  * @param bool          $byValue       If set to true, hydrator will always use entity's public API
  */
 public function __construct(ObjectManager $objectManager, $targetClass, $byValue = true)
 {
     parent::__construct();
     $this->objectManager = $objectManager;
     $this->metadata = $objectManager->getClassMetadata($targetClass);
     $this->byValue = (bool) $byValue;
     $this->prepare();
 }
Example #4
0
 /**
  * Define if extract values will use camel case or name with underscore
  * @param bool|array $underscoreSeparatedKeys
  */
 public function __construct($underscoreSeparatedKeys = true)
 {
     parent::__construct();
     $this->setUnderscoreSeparatedKeys($underscoreSeparatedKeys);
     $this->filterComposite->addFilter("is", new IsFilter());
     $this->filterComposite->addFilter("has", new HasFilter());
     $this->filterComposite->addFilter("get", new GetFilter());
     $this->filterComposite->addFilter("parameter", new NumberOfParameterFilter(), FilterComposite::CONDITION_AND);
 }
 /**
  * @param ObjectManager     $objectManager
  * @param HydratorInterface $hydrator
  */
 public function __construct(ObjectManager $objectManager, HydratorInterface $hydrator = null)
 {
     $this->objectManager = $objectManager;
     if (null === $hydrator) {
         $hydrator = new ClassMethodsHydrator(false);
     }
     $this->setHydrator($hydrator);
     parent::__construct();
 }
Example #6
0
 /**
  * Define if extract values will use camel case or name with underscore
  * @param bool|array $underscoreSeparatedKeys
  */
 public function __construct($underscoreSeparatedKeys = true)
 {
     parent::__construct();
     $this->setUnderscoreSeparatedKeys($underscoreSeparatedKeys);
     $this->callableMethodFilter = new OptionalParametersFilter();
     $this->filterComposite->addFilter('is', new IsFilter());
     $this->filterComposite->addFilter('has', new HasFilter());
     $this->filterComposite->addFilter('get', new GetFilter());
     $this->filterComposite->addFilter('parameter', new OptionalParametersFilter(), FilterComposite::CONDITION_AND);
 }
Example #7
0
 public function __construct()
 {
     parent::__construct();
     $this->init();
 }
Example #8
0
 /**
  * Define if extract values will use camel case or name with underscore
  * @param boolean $underscoreSeparatedKeys
  */
 public function __construct($underscoreSeparatedKeys = true)
 {
     parent::__construct();
     $this->underscoreSeparatedKeys = $underscoreSeparatedKeys;
 }
Example #9
0
 /**
  * Creates a social profiles collection hydrator.
  * 
  * @param array $profileClassMap
  */
 public function __construct(array $profileClassMap = array())
 {
     parent::__construct();
     $this->profileClassMap = array_merge($this->profileClassMap, $profileClassMap);
 }
Example #10
0
 public function __construct()
 {
     parent::__construct();
     $this->init();
     $this->excludeMethods = array();
 }
Example #11
0
 /**
  * Constructor
  *
  * @param Mandango $objectManager The ObjectManager to use
  * @param string   $modelClass    The FQCN of the hydrated/extracted object
  */
 public function __construct(Mandango $mandango, $modelClass)
 {
     parent::__construct();
     $this->mandango = $mandango;
     $this->metadata = $mandango->getMetadata($modelClass);
 }