1

We are trying to profile accounts to build data that we want to compare against other accounts. For this we are using Mysql Views. I was wondering how to use the same using CakePHP

1 Answer 1

2

A view in MySQL is much like a table. So you can get the data in a view by calling it with a query:

$this->AnyModelName->query("SELECT * FROM my_view_1 WHERE 1");

You can also try to write a model that initially has $this->useTable set to false. Then if you define your own constructor for this class you may be able to initialize it with a different view every time. Check the Model documentation: API & Book.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.