Location: PHPKode > projects > Jethro Pastoral Ministry Manager > jethro-pmm/db_objects/person_group_category.class.php
<?php
include_once 'include/db_object.class.php';
class Person_Group_Category extends db_object
{
	function _getFields()
	{
		return Array(
			'name'				=> Array(
									'type'		=> 'text',
									'width'		=> 40,
									'maxlength'	=> 128,
									'allow_empty'	=> FALSE,
									'initial_cap'	=> TRUE,
								),
			'parent_category'	=> Array(
									'type'	=> 'reference',
									'references'	=> 'person_group_category',
									'editable'		=> true,
									'note'			=> 'To make this a top-level category, leave this blank',
									'allow_empty'	=> true,
								),
		);
	}

	function delete()
	{
		if (parent::delete()) {
			$sql = 'UPDATE person_group SET categoryid = 0 WHERE categoryid = '.(int)$this->id;
			return true;
		}
		return false;
	}

}
?>
Return current item: Jethro Pastoral Ministry Manager