Maddy
unread,Oct 27, 2009, 7:33:00 AM10/27/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to CakePHP-de für deutsche CakePHP Entwickler
Hallo, wie kann ich eine PHP Funktion in einer HABTM Regel in einem
Model ohne einen Escape Fehler nutzen?
Ein Beispiel:
var $hasAndBelongsToMany = array(
'User' => array(
…
'conditions' => array(
// 'User.expire_account > ' . date("Y-m-d", time
()),
'User.expire_account >' => date('Y-m-d', time
()),
)
)
);
Gibt zurück: Parse error: syntax error, unexpected '(', expecting ')'
in…
Gibt es eine elegantere Lösung als diese?
function beforeFind($query) {
$this->hasAndBelongsToMany['User']['conditions']
['User.expire_account >'] = date('Y-m-d', time());
}