rendered paste body<?phpclass NewsRecord extends Doctrine_Record{ public function setTableDefinition() { $this -> setTableName('news'); $this -> hasColumn('name', 'string', 50); $this -> hasColumn('intro', 'text'); $this -> hasColumn('text', 'text'); $this -> hasColumn('time', 'timestamp'); $this -> hasColumn('author', 'integer'); $this -> hasColumn('commenting', 'enum', 2, array('values' => array('0', '1'))); $this -> hasColumn('comments', 'integer'); $this -> option('type', 'INNODB'); $this -> option('collate', 'utf8_general_ci'); $this -> option('charset', 'utf8'); } public function setUp(){ $this -> hasOne('UserRecord as Author', array('local' => 'author', 'foreign' => 'id')); $this -> hasMany('CommentRecord as Comments', array('local' => 'id', 'foreign' => 'id')); } public function getFormatedTitle(){ $input = $this -> get('title'); /*$find = array('ą', 'ć', 'ę', 'ł', 'ń', 'ś', 'ó', 'ż', 'ź'); $replace = array('a', 'c', 'e', 'l', 'n', 's', 'o', 'z', 'z'); $return = str_replace($find, $replace, $input); $return = preg_replace('([^a-zA-Z0-9\-_]+)', '_', $return); */ return $return; } }?>