protected function cacheModelByCompoundKey(\Tx_Oelib_Model $model, array $data)
    {
        if (empty($this->compoundKeyParts)) {
            throw new \BadMethodCallException(
                'The compound key parts are not defined.',
                1363806895
            );
        }
        $values = [];
        foreach ($this->compoundKeyParts as $key) {
            if (isset($data[$key])) {
                $values[] = $data[$key];
            }
        }
        if (count($this->compoundKeyParts) === count($values)) {
            $value = implode('.', $values);
            if ($value !== '') {
                $this->cacheByCompoundKey[$value] = $model;
            }
        }
    }
protected function cacheModelByCompoundKey(\Tx_Oelib_Model $model, array $data)
    {
        if (empty($this->compoundKeyParts)) {
            throw new \BadMethodCallException(
                'The compound key parts are not defined.',
                1363806895
            );
        }
        $values = [];
        foreach ($this->compoundKeyParts as $key) {
            if (isset($data[$key])) {
                $values[] = $data[$key];
            }
        }
        if (count($this->compoundKeyParts) === count($values)) {
            $value = implode('.', $values);
            if ($value !== '') {
                $this->cacheByCompoundKey[$value] = $model;
            }
        }
    }
protected function cacheModelByCompoundKey ( \ Tx_Oelib_Model $ model , array $ data ) { if ( empty ( $ this -> compoundKeyParts ) ) { throw new \ BadMethodCallException ( 'The compound key parts are not defined.' , 1363806895 ) ; } $ values = [ ] ; foreach ( $ this -> compoundKeyParts as $ key ) { if ( isset ( $ data [ $ key ] ) ) { $ values [ ] = $ data [ $ key ] ; } } if ( count ( $ this -> compoundKeyParts ) === count ( $ values ) ) { $ value = implode ( '.' , $ values ) ; if ( $ value !== '' ) { $ this -> cacheByCompoundKey [ $ value ] = $ model ; } } }
Automatically caches a model by an additional compound key.

It is cached only if all parts of the compound key have values.

This method works automatically; it is not necessary to overwrite it.

@param \Tx_Oelib_Model $model the model to cache
@param string[] $data the data of the model as it is in the DB, may be empty

@throws \BadMethodCallException

@return void
Automatically caches a model by an additional compound key .