06.27
php
saved
davemo
Note
web_page.php model
web_page.php model
- <?php
- class WebPage extends AppModel {
- const IS_ACTIVE = 1;
- const IS_NOT_ACTIVE = 0;
- var $name = 'WebPage';
- 'message' => 'Your title must be between 3 and 30 characters.'
- ),
- 'message' => 'Your title can not contain any of the following characters: @ . : ; / \\ % _ '
- ),
- 'message' => 'This title has already been used within this section.'
- )
- ),
- );
- function validTitleChars( $data ) {
- $valid = true;
- // QUOTATIONS!?
- while( $valid && $i )
- return( $valid );
- }
- function uniqueInSection($data) {
- $unique = false;
- $parent_id = $this->data['WebPage']['parent_id'];
- $title = $this->data['WebPage']['title'];
- if( ! ( $this->find( "WebPage.parent_id = $parent_id and WebPage.title like '$title'" ) ) )
- {
- $unique = true;
- }
- return $unique;
- }
- //The Associations below have been created with all possible keys, those that are not needed can be removed
- 'foreignKey' => 'parent_id',
- 'conditions' => '',
- 'fields' => '',
- 'order' => ''
- ),
- 'foreignKey' => 'user_id',
- 'conditions' => '',
- 'fields' => '',
- 'order' => ''
- ),
- 'foreignKey' => 'web_page_type_id',
- 'conditions' => '',
- 'fields' => '',
- 'order' => ''
- ),
- 'foreignKey' => 'team_id',
- 'conditions' => '',
- 'fields' => '',
- 'order' => ''
- ),
- 'foreignKey' => 'site_id',
- 'conditions' => '',
- 'fields' => '',
- 'order' => ''
- )
- );
- /* 'Resource' => array('className' => 'Resource',
- 'foreignKey' => 'resource_id',
- 'dependent' => false,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'exclusive' => '',
- 'finderQuery' => '',
- 'counterQuery' => ''
- ),*/
- 'foreignKey' => 'parent_id',
- 'dependent' => false,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'exclusive' => '',
- 'finderQuery' => '',
- 'counterQuery' => ''
- )
- );
- }
- ?>
Parsed in 0.253 seconds, using GeSHi 1.0.7.14