mirror of
https://github.com/jimeh/zynapse.git
synced 2026-02-19 07:06:39 +00:00
Initial import of old legacy Zynapse Framework,
untouched since early 2008.
This commit is contained in:
41
app/models/page.php
Normal file
41
app/models/page.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
class Page extends ActiveRecord {
|
||||
|
||||
public $has_many = 'comments';
|
||||
public $has_and_belongs_to_many = 'categories';
|
||||
|
||||
|
||||
|
||||
// public $has_many = array(
|
||||
// 'comments' => array(
|
||||
// 'class_name' => 'Comment',
|
||||
// 'foreign_key' => 'page_id',
|
||||
// 'conditions' => array('is_public' => 1),
|
||||
// ),
|
||||
// );
|
||||
|
||||
|
||||
// public $table_name = 'whatever';
|
||||
// public $primary_key = 'id';
|
||||
|
||||
|
||||
// public $type = 'mysql';
|
||||
// public $host = 'db.domain.com';
|
||||
// public $database = 'librarious_db';
|
||||
// public $username = 'root';
|
||||
// public $password = '';
|
||||
// public $persistent = false;
|
||||
// public $table_prefix = 'znap_';
|
||||
// public $table_name = 'collection';
|
||||
|
||||
|
||||
function validate_title () {
|
||||
if ( $this->title == '' ) {
|
||||
$this->error_title = 'Title can not be empty.';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user