public function add(array $results)
    {
        $cachedResults = [];

        $keyColumn = $this->entityMap->getKeyName();

        foreach ($results as $result) {
            $id = $result[$keyColumn];

            // Forget the ID field from the cache attributes
            // to prevent any side effect.
            // TODO : remove primary key check from dirty attributes parsing
            //unset($result[$keyColumn]);
            $cachedResults[$id] = $this->rawResult($result);
        }

        if (empty($this->cache)) {
            $this->cache = $cachedResults;
        } else {
            $this->mergeCacheResults($cachedResults);
        }
    }
public function add(array $results)
    {
        $cachedResults = [];

        $keyColumn = $this->entityMap->getKeyName();

        foreach ($results as $result) {
            $id = $result[$keyColumn];

            // Forget the ID field from the cache attributes
            // to prevent any side effect.
            // TODO : remove primary key check from dirty attributes parsing
            //unset($result[$keyColumn]);
            $cachedResults[$id] = $this->rawResult($result);
        }

        if (empty($this->cache)) {
            $this->cache = $cachedResults;
        } else {
            $this->mergeCacheResults($cachedResults);
        }
    }
public function add ( array $ results ) { $ cachedResults = [ ] ; $ keyColumn = $ this -> entityMap -> getKeyName ( ) ; foreach ( $ results as $ result ) { $ id = $ result [ $ keyColumn ] ; // Forget the ID field from the cache attributes // to prevent any side effect. // TODO : remove primary key check from dirty attributes parsing //unset($result[$keyColumn]); $ cachedResults [ $ id ] = $ this -> rawResult ( $ result ) ; } if ( empty ( $ this -> cache ) ) { $ this -> cache = $ cachedResults ; } else { $ this -> mergeCacheResults ( $ cachedResults ) ; } }
Add an array of key=>attributes representing
the initial state of loaded entities.

@param array $results
Add an array of key = > attributes representing the initial state of loaded entities .