mirror of
https://github.com/Oreolek/kangana.git
synced 2024-07-08 01:24:23 +03:00
46 lines
1 KiB
PHP
46 lines
1 KiB
PHP
<?php defined('SYSPATH') OR die('No direct access allowed.');
|
|
/**
|
|
* Subscription model.
|
|
* Subscription is an ordered collection of letters.
|
|
* It has a period in days. Every <period> days a client receives a letter from the collection.
|
|
* @package Models
|
|
* @author Oreolek
|
|
**/
|
|
class Model_Subscription extends ORM {
|
|
|
|
/**
|
|
* @return array validation rules
|
|
**/
|
|
public function rules()
|
|
{
|
|
return array(
|
|
'title' => array(
|
|
array('not_empty'),
|
|
array('min_length', array(':value', 4)),
|
|
array('max_length', array(':value', 100)),
|
|
)
|
|
'description' => array(
|
|
array('not_empty'),
|
|
array('min_length', array(':value', 20)),
|
|
),
|
|
'period' => array(
|
|
array('numeric')
|
|
),
|
|
'price' => array(
|
|
array('numeric')
|
|
)
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Array of field labels.
|
|
* Used in forms.
|
|
**/
|
|
protected $_labels = array(
|
|
'title' => 'Title',
|
|
'price' => 'Subscription price',
|
|
'period' => 'Mailing period (in days)',
|
|
'description' => 'Description (for the clients)'
|
|
);
|
|
}
|