DB\Jig::read PHP Method

read() public method

Read data from memory/file
public read ( $file ) : array
$file string
return array
    function &read($file)
    {
        if (!$this->dir || !is_file($dst = $this->dir . $file)) {
            if (!isset($this->data[$file])) {
                $this->data[$file] = [];
            }
            return $this->data[$file];
        }
        $fw = \Base::instance();
        $raw = $fw->read($dst);
        switch ($this->format) {
            case self::FORMAT_JSON:
                $data = json_decode($raw, TRUE);
                break;
            case self::FORMAT_Serialized:
                $data = $fw->unserialize($raw);
                break;
        }
        $this->data[$file] = $data;
        return $this->data[$file];
    }