Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

88 lines (82 sloc) 1.472 kB
<?php
/**
* Block
*
* PHP version 5
*
* @category Model
* @package Croogo
* @version 1.0
* @author Fahad Ibnay Heylaal <contact@fahad19.com>
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @link http://www.croogo.org
*/
class Block extends AppModel {
/**
* Model name
*
* @var string
* @access public
*/
public $name = 'Block';
/**
* Behaviors used by the Model
*
* @var array
* @access public
*/
public $actsAs = array(
'Encoder',
'Ordered' => array(
'field' => 'weight',
'foreign_key' => false,
),
'Cached' => array(
'prefix' => array(
'block_',
'blocks_',
'croogo_blocks_',
),
),
'Params',
);
/**
* Validation
*
* @var array
* @access public
*/
public $validate = array(
'title' => array(
'rule' => array('minLength', 1),
'message' => 'Title cannot be empty.',
),
'alias' => array(
'isUnique' => array(
'rule' => 'isUnique',
'message' => 'This alias has already been taken.',
),
'minLength' => array(
'rule' => array('minLength', 1),
'message' => 'Alias cannot be empty.',
),
),
);
/**
* Model associations: belongsTo
*
* @var array
* @access public
*/
public $belongsTo = array(
'Region' => array(
'className' => 'Region',
'foreignKey' => 'region_id',
'conditions' => '',
'fields' => '',
'order' => '',
'counterCache' => true,
'counterScope' => array('Block.status' => 1),
),
);
}
Jump to Line
Something went wrong with that request. Please try again.