Fatal Error

Out of memory (allocated 2097152) (tried to allocate 20480 bytes) search►

Source file

File: .../nette/database/src/Database/Table/Selection.php:701

<?php

/**
 * This file is part of the Nette Framework (https://nette.org)
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 */

namespace Nette\Database\Table;

use 
Nette;
use 
Nette\Database\Context;
use 
Nette\Database\IConventions;


/**
 * Filtered table representation.
 * Selection is based on the great library NotORM http://www.notorm.com written by Jakub Vrana.
 */
class Selection implements \IteratorIRowContainer, \ArrayAccess, \Countable
{
    use 
Nette\SmartObject;

    
/** @var Context */
    
protected $context;

    
/** @var IConventions */
    
protected $conventions;

    
/** @var Nette\Caching\Cache */
    
protected $cache;

    
/** @var SqlBuilder */
    
protected $sqlBuilder;

    
/** @var string table name */
    
protected $name;

    
/** @var string|array|NULL primary key field name */
    
protected $primary;

    
/** @var string|bool primary column sequence name, FALSE for autodetection */
    
protected $primarySequence FALSE;

    
/** @var IRow[] data read from database in [primary key => IRow] format */
    
protected $rows;

    
/** @var IRow[] modifiable data in [primary key => IRow] format */
    
protected $data;

    
/** @var bool */
    
protected $dataRefreshed FALSE;

    
/** @var mixed cache array of Selection and GroupedSelection prototypes */
    
protected $globalRefCache;

    
/** @var mixed */
    
protected $refCache;

    
/** @var string */
    
protected $generalCacheKey;

    
/** @var string */
    
protected $specificCacheKey;

    
/** @var array of [conditions => [key => IRow]]; used by GroupedSelection */
    
protected $aggregation = [];

    
/** @var array of touched columns */
    
protected $accessedColumns;

    
/** @var array of earlier touched columns */
    
protected $previousAccessedColumns;

    
/** @var bool should instance observe accessed columns caching */
    
protected $observeCache FALSE;

    
/** @var array of primary key values */
    
protected $keys = [];


    
/**
     * Creates filtered table representation.
     * @param  Context
     * @param  IConventions
     * @param  string  table name
     * @param  Nette\Caching\IStorage|NULL
     */
    
public function __construct(Context $contextIConventions $conventions$tableNameNette\Caching\IStorage $cacheStorage NULL)
    {
        
$this->context $context;
        
$this->conventions $conventions;
        
$this->name $tableName;

        
$this->cache $cacheStorage ? new Nette\Caching\Cache($cacheStorage'Nette.Database.' md5($context->getConnection()->getDsn())) : NULL;
        
$this->primary $conventions->getPrimary($tableName);
        
$this->sqlBuilder = new SqlBuilder($tableName$context);
        
$this->refCache = &$this->getRefTable($refPath)->globalRefCache[$refPath];
    }


    public function 
__destruct()
    {
        
$this->saveCacheState();
    }


    public function 
__clone()
    {
        
$this->