CMS  Version 3.9
scroll.inc
Go to the documentation of this file.
1 <?php
7 class Scroll extends DataItem
8 {
9  var $table = "scroll";
10  var $primary_key = "scroll_id";
11 
12  var $fields = array("scroll_id" => Number,
13  "identifier" => String,
14  "title" => String,
15  "meta_tag_description" => Text,
16  "meta_tag_keyword" => String,
17  "site_id" => Number,
18  "show_internal_navigation" => Boolean,
19  "exclude_from_search" => Boolean,
20  "created_date" => Date,
21  "edited_date" => Timestamp);
22 
23  var $relations = array( "Parts" => ScrollPart,
24  "Site" => Site);
25 
26  function Parts($constraint = "ORDER BY sort_order")
27  {
28  return $this->getRelatedList(ScrollPart, "", $constraint);
29  }
30 
31  function Site()
32  {
33  return $this->getRelated(Site);
34  }
35 
36  function countParts()
37  {
38  return Query::create(ScrollPart, "WHERE scroll_id=:s")->bind(":s", $this->scroll_id)->count();
39  }
40 
41  static function findByIdentifier($identifier)
42  {
43  $match = Query::create(Scroll, "WHERE identifier=:id")
44  ->bind(":id", $identifier)
45  ->executeSingle();
46 
47  return $match;
48  }
49 }?>
$constraint
Definition: scroll.inc:8
$table
Definition: scroll.inc:9
static findByIdentifier($identifier)
Definition: scroll.inc:41
countParts()
Definition: scroll.inc:36
$relations
Definition: scroll.inc:23
$primary_key
Definition: scroll.inc:10
$fields
Definition: scroll.inc:12
Site()
Definition: scroll.inc:31
Parts($constraint="ORDER BY sort_order")
Definition: scroll.inc:26
Definition: site.inc:40
$identifier
Definition: rss.inc:37
$part scroll_id