/
Edit.php
34 lines (32 loc) · 846 Bytes
/
Edit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Edit
*
* @author robert
*/
class Planet_Form_News_Edit extends Planet_Form_News
{
public function init()
{
parent::init();
}
public function setSlugValidator()
{
$this->getElement('slug')->addValidator(
'Db_NoRecordExists',
false,
array(
'table' => $this->getModel()->getResource('News')->getPrefix() . 'news',
'field' => 'slug',
'exclude' => array(
'field' => 'id',
'value' => $this->getElement('id')->getValue()
)
)
);
}
}