/** * @return array validation rules for model attributes. */ public function rules() { return array(['cli_fname, cli_sname, cli_email', 'required'], ['telephones', 'checkTelephones', 'on' => 'validPhoneOnInsert'], ['addressID', 'checkAddressID'], ['propertyCategoryIds, propertyTypesIds', 'safe'], ['cli_salemin, cli_salemax', 'numerical', 'allowEmpty' => true, 'on' => 'search'], ['budget', 'numerical', 'allowEmpty' => true], ['budget', 'default', 'setOnEmpty' => true, 'value' => null], ['cli_salebed, cli_source,cli_neg,cli_branch, cli_salestatus, searchPrice', 'numerical', 'allowEmpty' => true], ['cli_email, secondaryEmail', 'email'], ['cli_saleemail, cli_sales', 'in', 'range' => [Client::EMAIL_SALES_YES, Client::EMAIL_SALES_NO]], ['cli_fname, cli_sname', 'type', 'type' => 'string'], ['cli_salutation', 'in', 'range' => Client::getSalutationTypes()], ['cli_preferred', 'in', 'range' => CLient::getContactMethods()], ['lastContacted', 'default', 'setOnEmpty' => true, 'value' => null], ['minPrice, maxPrice', 'numerical', 'allowEmpty' => true, 'on' => 'search'], ['searchNoBudget, searchNoMinimumBeds', 'boolean', 'allowEmpty' => true, 'on' => 'search'], ['matchingPostcode', 'unsafe'], ['invalidEmail', 'in', 'range' => [0, 1]], ['invalidEmail', 'default', 'setOnEmpty' => 0, 'value' => 0], ['searchPostcodes', 'safe', 'on' => 'search'], ['fullName, cli_id, cli_status, cli_method, cli_source, cli_preferred, cli_created, cli_reviewed, cli_vendor, cli_landlord, cli_sales, cli_lettings, cli_regd, cli_branch, cli_neg, cli_solicitor, cli_salutation, cli_fname, cli_sname, cli_pro, cli_email, cli_password, cli_question, cli_answer, cli_salemin, cli_salemax, cli_salebed, cli_saleemail, cli_saleptype, cli_salereq, cli_letptype, cli_letreq, cli_area, cli_oldnotes, cli_oldaddr, cli_salestatus, cli_mortgagestatus, cli_timestamp, cli_deposit, cli_selling, cli_renting, cli_wparents, cli_valuation, cli_workstatus, cli_student, cli_moveby', 'safe', 'on' => 'search']); }