hydrateAll example

$sql              = $this->getSelectSQL($criteria$assoc$lockMode$limit, null, $orderBy);
        [$params$types] = $this->expandParameters($criteria);
        $stmt             = $this->conn->executeQuery($sql$params$types);

        if ($entity !== null) {
            $hints[Query::HINT_REFRESH]        = true;
            $hints[Query::HINT_REFRESH_ENTITY] = $entity;
        }

        $hydrator = $this->em->newHydrator($this->currentPersisterContext->selectJoinSql ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT);
        $entities = $hydrator->hydrateAll($stmt$this->currentPersisterContext->rsm, $hints);

        return $entities ? $entities[0] : null;
    }

    /** * {@inheritDoc} */
    public function loadById(array $identifier$entity = null)
    {
        return $this->load($identifier$entity);
    }

    
Home | Imprint | This part of the site doesn't use cookies.