protected function __afterInsert(\Owl\DataMapper\Data $data)
    {
        $policy = $this->getCachePolicy();
        $id = $data->id(true);

        if ($policy['insert']) {
            $record = $this->unpack($data);
            $record = $this->removeNullValues($record);

            $this->saveCache($id, $record);
        } elseif ($policy['not_found']) {
            $this->deleteCache($id);
        }

        parent::__afterInsert($data);
    }
protected function __afterInsert(\Owl\DataMapper\Data $data)
    {
        $policy = $this->getCachePolicy();
        $id = $data->id(true);

        if ($policy['insert']) {
            $record = $this->unpack($data);
            $record = $this->removeNullValues($record);

            $this->saveCache($id, $record);
        } elseif ($policy['not_found']) {
            $this->deleteCache($id);
        }

        parent::__afterInsert($data);
    }
protected function __afterInsert ( \ Owl \ DataMapper \ Data $ data ) { $ policy = $ this -> getCachePolicy ( ) ; $ id = $ data -> id ( true ) ; if ( $ policy [ 'insert' ] ) { $ record = $ this -> unpack ( $ data ) ; $ record = $ this -> removeNullValues ( $ record ) ; $ this -> saveCache ( $ id , $ record ) ; } elseif ( $ policy [ 'not_found' ] ) { $ this -> deleteCache ( $ id ) ; } parent :: __afterInsert ( $ data ) ; }
create cache after save new data, if cache policy set.

@param \Owl\DataMapper\Data $data
create cache after save new data if cache policy set .