开发者

CakePHP saving data from Google Analytics

开发者 https://www.devze.com 2023-02-11 00:36 出处:网络
I\'ve been working with this plugin: http://www.neilcrookes.com/2009/09/27/get-google-analytics-data-in-your-cakephp/ but honestly it\'s over my head.

I've been working with this plugin: http://www.neilcrookes.com/2009/09/27/get-google-analytics-data-in-your-cakephp/ but honestly it's over my head.

Under Analytic.php it seems useTable is set to false, however, when it's true it throws an error. I am new to Cake and Cake plugins, so maybe I am interacting the wrong way.

I'd like to save the dimensions and metrics being pulled into a database using cake. Any direction would be gre开发者_如何学Catly appreciated.


the model has useTable = false as it is using a datasource to get the data. you cant just set it to true, and it wont work any other way. if you want to save it create a new model with a db table like normal and then do something like the following.

in new model...

$data = ClassRegistry::init('AnaliticsModel')->findMethod();

then manipulate it how you need

$this->save($data);

its now in your db... you can then do $this->find() <-- normal cake stuff on the new model

0

精彩评论

暂无评论...
验证码 换一张
取 消