bindmodel cakephp
// Our case:
MemberNotification -> BelongsTo -> Notification,
Notification -> HasMany -> NotificationLanguage
$this->MemberNotification->recursive = 0;
$this->set('memberNotifications', $this->paginate());
$this->MemberNotification->bindModel(array(
'belongsTo' => array(
'NotificationLanguage' => array(
'foreignKey' => false,
'conditions' => array('Notification.id = NotificationLanguage.notification_id')
),
)
));
// our purpose just make the NotificationLanguage same level with the Notification,
// so we can sort 2nd level association
Also in PHP:
- add unique value in array php
- Modularizing laravel 8.0
- check current datetime in php
- enable all php errors
- carbon add minutes
- Cannot access protected property Slim\Slim::$mode in
- change time format php
- char exists in string php
- Warning: get_browser(): browscap ini directive not set in
- Undefined index: $fileName = basename($_FILES["file"]["name"]);file in D:\xampp\htdocs\upload.php on line 12
- find string in a string php
- Use Laravel for server
- file_get_contents base64 php
- add days in datetime php
- array in php
- composer require laravel/ui not working laravel 7
- db import laravel
- find char in string php
- array merge in php
- Error:Cannot create file "C:\xampp\xampp-control.ini". Access denied
- file_get_contents() [function.file-get-contents]: SSL operation failed with code 1. OpenSSL Error messages
- check the data type in php
- check if keys exists array php
- ErrorException without try catch