Created
February 27, 2016 14:18
-
-
Save cakephp-tutorial/d0e9b86b34d50756bc46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# /app/Model/Order.php | |
class Order extends AppModel { | |
public $hasAndBelongsToMany = array('Region'); | |
public $validate = array( | |
'company' => array( | |
'rule' => array('notEmpty'), | |
'required' => true, | |
'message' => 'inserire un nome azienda' | |
), | |
'email' => array( | |
'rule' => 'email', | |
'required' => true, | |
'message' => 'inserire un indirizzo email valido' | |
), | |
'Region' => array( | |
'rule' => array('multiple', array('min' => 1)), | |
'required' => true, | |
'message' => 'selezionare almeno una regione' | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment