Category: CakePHP

Work with contain hasMany association and to retrieve particular fields only?

I'd like to know how to retrieve particular fields in the associated table when using containable queries? To be more specified, I have the following tables: Posts, Users that a user may have one or m

SOLVED #contain #association #hasmany
1 Answers
Kristi
Kristi

137

Category: CakePHP

Table::get($name)->hasAny(['key' => 'value'] is not working in cakephp 3

Cake shows error unknown method "hasAny" when checking a record exists or not. Neither this..TableRegistry::get('Posts')->hasAny(['Post.id' => 1]);or that$this->Posts->hasAny(array(['Post.

SOLVED
1 Answers
Kristi
Kristi

137

Category: CakePHP

How to prevent Oauth2 app key and secret hard-coded in CakePHP?

Again Hi,I have a small application that uses Oauth2 to interact with third party service provider. I'd like to know if there is any way to protect key/secret in source code that other people cannot a

SOLVED #cakephp #security
1 Answers

Category: CakePHP

How to check latest SQL logs in the controller?

Hi,Is there a way to see latest SQL logs in CakePHP's controllers? I'd like to do this checking in my controller before rendering a view. Like: <?php echo $this->element('sql_dump'); ?

#cakephp #sql
1 Answers