public function __wakeup()
{
if ($this->constraint !== null) {
$this->queryBuilder->where($this->constraint);
}
if (is_array($this->orderings)) {
$aliases = $this->queryBuilder->getRootAliases();
foreach ($this->orderings as $propertyName => $order) {
$this->queryBuilder->addOrderBy($aliases[0] . '.' . $propertyName, $order);
}
}
if (is_array($this->joins)) {
foreach ($this->joins as $joinAlias => $join) {
$this->queryBuilder->leftJoin($join, $joinAlias);
}
}
$this->queryBuilder->setFirstResult($this->offset);
$this->queryBuilder->setMaxResults($this->limit);
$this->queryBuilder->distinct($this->distinct);
$this->queryBuilder->setParameters($this->parameters);
unset($this->parameters);
}