/app/models/ca_bookmarks.php
PHP | 200 lines | 107 code | 21 blank | 72 comment | 0 complexity | a5957981136a6fd53fce182e1f9dd99f MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, GPL-3.0, LGPL-2.0, LGPL-3.0
- <?php
- /** ---------------------------------------------------------------------
- * app/models/ca_bookmarks.php
- * ----------------------------------------------------------------------
- * CollectiveAccess
- * Open-source collections management software
- * ----------------------------------------------------------------------
- *
- * Software by Whirl-i-Gig (http://www.whirl-i-gig.com)
- * Copyright 2011 Whirl-i-Gig
- *
- * For more information visit http://www.CollectiveAccess.org
- *
- * This program is free software; you may redistribute it and/or modify it under
- * the terms of the provided license as published by Whirl-i-Gig
- *
- * CollectiveAccess is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * This source code is free and modifiable under the terms of
- * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
- * the "license.txt" file for details, or visit the CollectiveAccess web site at
- * http://www.CollectiveAccess.org
- *
- * @package CollectiveAccess
- * @subpackage models
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License version 3
- *
- * ----------------------------------------------------------------------
- */
-
- /**
- *
- */
- require_once(__CA_MODELS_DIR__.'/ca_bookmark_folders.php');
- BaseModel::$s_ca_models_definitions['ca_bookmarks'] = array(
- 'NAME_SINGULAR' => _t('bookmark'),
- 'NAME_PLURAL' => _t('bookmarks'),
- 'FIELDS' => array(
- 'bookmark_id' => array(
- 'FIELD_TYPE' => FT_NUMBER, 'DISPLAY_TYPE' => DT_HIDDEN,
- 'IDENTITY' => true, 'DISPLAY_WIDTH' => 10, 'DISPLAY_HEIGHT' => 1,
- 'IS_NULL' => false,
- 'DEFAULT' => '',
- 'LABEL' => _t('CollectiveAccess id'), 'DESCRIPTION' => _t('Unique numeric identifier used by CollectiveAccess internally to identify this bookmark')
- ),
- 'folder_id' => array(
- 'FIELD_TYPE' => FT_NUMBER, 'DISPLAY_TYPE' => DT_SELECT,
- 'DISPLAY_WIDTH' => 40, 'DISPLAY_HEIGHT' => 1,
- 'DISPLAY_FIELD' => array('ca_bookmark_folders.folder_id'),
- 'DISPLAY_ORDERBY' => array('ca_bookmark_folders.name'),
- 'IS_NULL' => false,
- 'DEFAULT' => '',
- 'LABEL' => _t('Folder'), 'DESCRIPTION' => _t('Indicates the folder to which the bookmark belongs.')
- ),
- 'table_num' => array(
- 'FIELD_TYPE' => FT_NUMBER, 'DISPLAY_TYPE' => DT_SELECT,
- 'DISPLAY_WIDTH' => 40, 'DISPLAY_HEIGHT' => 1,
- 'IS_NULL' => false,
- 'DEFAULT' => '',
- 'LABEL' => _t('Bookmark type'), 'DESCRIPTION' => _t('Indicates type of item bookmark represents.'),
- 'BOUNDS_CHOICE_LIST' => array(
- _t('objects') => 57,
- _t('object lots') => 51,
- _t('entities') => 20,
- _t('places') => 72,
- _t('occurrences') => 67,
- _t('collections') => 13,
- _t('storage locations') => 89,
- _t('loans') => 133,
- _t('movements') => 137,
- _t('tours') => 153,
- _t('tour stops') => 155,
- _t('object representations') => 56,
- _t('representation annotations') => 82,
- _t('list items') => 33
- ),
- 'BOUNDS_LENGTH' => array(1,100)
- ),
- 'row_id' => array(
- 'FIELD_TYPE' => FT_NUMBER, 'DISPLAY_TYPE' => DT_OMIT,
- 'DISPLAY_WIDTH' => 10, 'DISPLAY_HEIGHT' => 1,
- 'IS_NULL' => false,
- 'DEFAULT' => '',
- 'LABEL' => 'Row id', 'DESCRIPTION' => 'Identifier for row included in the bookmark list'
- ),
- 'rank' => array(
- 'FIELD_TYPE' => FT_NUMBER, 'DISPLAY_TYPE' => DT_FIELD,
- 'DISPLAY_WIDTH' => 10, 'DISPLAY_HEIGHT' => 1,
- 'IS_NULL' => false,
- 'DEFAULT' => '',
- 'LABEL' => _t('Sort order'), 'DESCRIPTION' => _t('Sort order'),
- ),
- 'notes' => array(
- 'FIELD_TYPE' => FT_TEXT, 'DISPLAY_TYPE' => DT_FIELD,
- 'DISPLAY_WIDTH' => 80, 'DISPLAY_HEIGHT' => 5,
- 'IS_NULL' => false,
- 'DEFAULT' => '',
- 'LABEL' => _t('Notes'), 'DESCRIPTION' => _t('Notes pertaining to the bookmark and/or bookmarked item.'),
- 'BOUNDS_LENGTH' => array(0,65535)
- ),
- 'created_on' => array(
- 'FIELD_TYPE' => FT_TIMESTAMP, 'DISPLAY_TYPE' => DT_FIELD, 'UPDATE_ON_UPDATE' => true,
- 'DISPLAY_WIDTH' => 10, 'DISPLAY_HEIGHT' => 1,
- 'IS_NULL' => false,
- 'DEFAULT' => '',
- 'LABEL' => _t('Bookmark created on'), 'DESCRIPTION' => _t('Date/time the bookmark was created.'),
- ),
- )
- );
- class ca_bookmarks extends BaseModel {
- # ---------------------------------
- # --- Object attribute properties
- # ---------------------------------
- # Describe structure of content object's properties - eg. database fields and their
- # associated types, what modes are supported, et al.
- #
- # ------------------------------------------------------
- # --- Basic object parameters
- # ------------------------------------------------------
- # what table does this class represent?
- protected $TABLE = 'ca_bookmarks';
-
- # what is the primary key of the table?
- protected $PRIMARY_KEY = 'bookmark_id';
- # ------------------------------------------------------
- # --- Properties used by standard editing scripts
- #
- # These class properties allow generic scripts to properly display
- # records from the table represented by this class
- #
- # ------------------------------------------------------
- # Array of fields to display in a listing of records from this table
- protected $LIST_FIELDS = array('bookmark_id');
- # When the list of "list fields" above contains more than one field,
- # the LIST_DELIMITER text is displayed between fields as a delimiter.
- # This is typically a comma or space, but can be any string you like
- protected $LIST_DELIMITER = ' ';
- # What you'd call a single record from this table (eg. a "person")
- protected $NAME_SINGULAR;
- # What you'd call more than one record from this table (eg. "people")
- protected $NAME_PLURAL;
- # List of fields to sort listing of records by; you can use
- # SQL 'ASC' and 'DESC' here if you like.
- protected $ORDER_BY = array('bookmark_id');
- # If you want to order records arbitrarily, add a numeric field to the table and place
- # its name here. The generic list scripts can then use it to order table records.
- protected $RANK = '';
-
- # ------------------------------------------------------
- # Hierarchical table properties
- # ------------------------------------------------------
- protected $HIERARCHY_TYPE = null;
- protected $HIERARCHY_LEFT_INDEX_FLD = null;
- protected $HIERARCHY_RIGHT_INDEX_FLD = null;
- protected $HIERARCHY_PARENT_ID_FLD = null;
- protected $HIERARCHY_DEFINITION_TABLE = null;
- protected $HIERARCHY_ID_FLD = null;
- protected $HIERARCHY_POLY_TABLE = null;
-
- # ------------------------------------------------------
- # Change logging
- # ------------------------------------------------------
- protected $UNIT_ID_FIELD = null;
- protected $LOG_CHANGES_TO_SELF = false;
- protected $LOG_CHANGES_USING_AS_SUBJECT = array(
- "FOREIGN_KEYS" => array(
-
- ),
- "RELATED_TABLES" => array(
-
- )
- );
-
-
- # ------------------------------------------------------
- # $FIELDS contains information about each field in the table. The order in which the fields
- # are listed here is the order in which they will be returned using getFields()
- protected $FIELDS;
-
- # ----------------------------------------
- public function __construct($pn_id=null) {
- parent::__construct($pn_id);
- }
- # ----------------------------------------
- }
- ?>