public function persist($data = null)
    {
        if (is_null($data)) {
            $data = $this->database->toArray();
        }

        if (! is_array($data)) {
            $data = $data->toArray();
        }

        $this->makeDir($this->getFileName());

        file_put_contents($this->getFileName(), json_encode($data));
    }
public function persist($data = null)
    {
        if (is_null($data)) {
            $data = $this->database->toArray();
        }

        if (! is_array($data)) {
            $data = $data->toArray();
        }

        $this->makeDir($this->getFileName());

        file_put_contents($this->getFileName(), json_encode($data));
    }
public function persist ( $ data = null ) { if ( is_null ( $ data ) ) { $ data = $ this -> database -> toArray ( ) ; } if ( ! is_array ( $ data ) ) { $ data = $ data -> toArray ( ) ; } $ this -> makeDir ( $ this -> getFileName ( ) ) ; file_put_contents ( $ this -> getFileName ( ) , json_encode ( $ data ) ) ; }
Persist to database cache file.

@param $data
Persist to database cache file .