public function data($raw = false)
    {
        $data = $this->getArrayCopy();

        if ($raw) {
            foreach ($data as $key => $val) {
                if ($val instanceof Resource) {
                    $data[$key] = $val->data($raw);
                }
            }
            foreach ($this->link_data as $key => $val) {
                if ($val instanceof Resource) {
                    $data[$key] = $val->data($raw);
                }
            }
        }

        return $data;
    }