Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class article extends article_ext

Hide Inherited MembersContent Management
Description
No description.
 
Constants
constantTABLENAME ["cms_article"][ article ]
 
Properties
protected_article_type_id[ article_db ]
protected_article_type_id_dirty[ article_db ]
protected_articlestatus_id[ article_db ]
protected_articlestatus_id_dirty[ article_db ]
protected_cdate[ article_db ]
protected_cdate_dirty[ article_db ]
protected_content_id[ article_db ]
protected_content_id_dirty[ article_db ]
protected_content_type_id[ content_db ]
protected_content_type_id_dirty[ content_db ]
protected_data[ content_db ]
protected_data_dirty[ content_db ]
protected_deleted[ article_db ]
protected_deleted_dirty[ article_db ]
protected_dirty[ obj ]
protected_id[ content_db ]
protected__id[ article_db ]
protected__id_dirty[ article_db ]
protected_id_dirty[ content_db ]
protected_mdate[ article_db ]
protected_mdate_dirty[ article_db ]
publicproperty_objects_array[ obj ]
protected_sticky[ article_db ]
protected_sticky_dirty[ article_db ]
protected_summary[ content_db ]
protected_summary_dirty[ content_db ]
protected_title[ article_db ]
protected_title_dirty[ article_db ]
protected_top[ article_db ]
protected_top_dirty[ article_db ]
 
Methods
publiccommit ( )[ article_db ]
Parameters
No parameters for this method
Code
128  public function commit()
129  {
130      if ($this->_content_id > 0)
131      {
132          $this->update();
133      }
134      else
135      {
136          $this->insert();
137      }
138 
139      foreach ($this->property_objects_array as $property=>$object)
140      {
141          $this->{$property} = $object;
142      }
143 
144      return true;
145  }
public__construct ( content_id )[ article_db ]
Parameters
optionalcontent_id
Code
050  public function __construct($__content_id=null)
051  {
052      $this->__id = 0;
053      $this->_content_id = 0;
054      $this->_article_type_id = 0;
055      $this->_title = "";
056      $this->_sticky = false;
057      $this->_top = false;
058      $this->_articlestatus_id = 0;
059      $this->_mdate = null;
060      $this->_cdate = null;
061      $this->_deleted = false;
062      $this->_id = 0;
063      $this->_data = "";
064      $this->_summary = "";
065      $this->_content_type_id = 0;
066 
067      $this->__id_dirty = false;
068      $this->_content_id_dirty = false;
069      $this->_article_type_id_dirty = false;
070      $this->_title_dirty = false;
071      $this->_sticky_dirty = false;
072      $this->_top_dirty = false;
073      $this->_articlestatus_id_dirty = false;
074      $this->_mdate_dirty = false;
075      $this->_cdate_dirty = false;
076      $this->_deleted_dirty = false;
077      $this->_id_dirty = false;
078      $this->_data_dirty = false;
079      $this->_summary_dirty = false;
080      $this->_content_type_id_dirty = false;
081 
082      if (is_null($__content_id))
083      {
084          return;
085      }
086 
087      $db = article::db();
088      $q  = " SELECT cms_content.id,cms_content.data,cms_content.summary,cms_content.content_type_id,cms_article._id,cms_article.content_id,cms_article.article_type_id,cms_article.title,cms_article.sticky,cms_article.top,cms_article.articlestatus_id,cms_article.mdate,cms_article.cdate,cms_article.deleted ";
089      $q .= " FROM cms_article ";
090      $q .= " INNER JOIN cms_content ON cms_article.content_id=cms_content.id ";
091      $q .= is_null($__content_id) ? "" : " AND cms_content.id='$__content_id' ";       
092 
093      $db->query($q);
094      if ($db->next_record() && $db->num_rows() == 1)
095      {
096          $this->_id = $db->f("id");
097          $this->_data = $db->f("data");
098          $this->_summary = $db->f("summary");
099          $this->_content_type_id = $db->f("content_type_id");
100          $this->__id = $db->f("_id");
101          $this->_content_id = $db->f("content_id");
102          $this->_article_type_id = $db->f("article_type_id");
103          $this->_title = $db->f("title");
104          $this->_sticky = $db->f("sticky");
105          $this->_top = $db->f("top");
106          $this->_articlestatus_id = $db->f("articlestatus_id");
107          $this->_mdate = $db->f("mdate");
108          $this->_cdate = $db->f("cdate");
109          $this->_deleted = $db->f("deleted");
110      }
111  }
protected staticdb ( )[ article_db ]
Parameters
No parameters for this method
Code
524  protected static function db()
525  {
526      return new db();
527  }
publicdelete ( )[ article_db ]
Parameters
No parameters for this method
Code
195  public function delete()
196  {
197      parent::delete();
198      $db = article::db();
199      $q  = " UPDATE cms_article SET ";
200      $q .= " deleted = 1 ";
201      $q .= " WHERE content_id = " . $this->_content_id;
202      $db->query($q);
203      $this->deleted = true;
204      return true;
205  }
public staticdelete_all ( )[ article_db ]
Parameters
No parameters for this method
Code
308  public static function delete_all()
309  {
310      $db = article::db();
311      $q  = " UPDATE cms_article SET ";
312      $q .= " deleted = 1 ";
313     
314      $db->query($q);
315      return true;
316  }
public__get ( p )[ obj ]
Parameters
requiredp
Code
007  public function __get($p)
008  {
009      $methods = get_class_methods($this);
010      $properties = get_object_vars($this);
011      if (in_array("get_$p",$methods))
012      {
013          return $this->{"get_$p"}();
014      }
015      else if (array_key_exists("_$p",$properties))
016      {
017          return $this->{"_$p"};
018      }
019      else if (in_array("get_" . substr($p,strpos($p,"_")+1), $methods))
020      {
021          return $this->{"get_" . substr($p,strpos($p,"_")+1)}(substr($p,0,strpos($p,"_")));
022      }
023      else
024      {
025          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
026          return null;
027      }
028  }
publicget_array ( )[ obj ]
Parameters
No parameters for this method
Code
096  public function get_array()
097  {
098      return get_object_vars($this);
099  }
publicget_article_type ( )[ article_db ]
Parameters
No parameters for this method
Code
413  public function get_article_type()
414  {
415      return new article_type($this->article_type_id);
416  }
publicget_articlestatus ( )[ article_db ]
Parameters
No parameters for this method
Code
401  public function get_articlestatus()
402  {
403      return new articlestatus($this->articlestatus_id);
404  }
publicget_category ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
947  public function get_category($__type="default")
948  {
949      $object = is_null(keyval($this->property_objects_array,"{$__type}_category")) ? new category($this->get_category_id($__type)) : $this->property_objects_array["{$__type}_category"];
950      $this->property_objects_array["{$__type}_category"] = $object;
951      return $object;
952  }
publicget_category_id ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
953  public function get_category_id($__type="default")
954  {
955      $ids = $this->get_category_ids($__type, true);
956      return (count($ids)==1 ? $ids[0] : null);
957  }
publicget_category_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
958  public function get_category_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
959  {
960      $category_ids = array();
961      $db = content::db();
962      $q  = " SELECT cor_category.id FROM cms_category_content INNER JOIN cor_category ON cms_category_content.category_id=cor_category.id AND cms_category_content.deleted=0 AND cor_category.deleted=0 AND cms_category_content.content_id='$this->id' " . (is_null($__type) ? "" : " AND cms_category_content.category_content_type_id='" . category_content::type_id($__type) . "'") . ($__get_primary ? " AND cms_category_content.primary=1 " : "");
963      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
964      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
965      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
966      $db->query($q);
967      while ($db->next_record())
968      {
969          $category_ids[] = $db->f("id");
970      }
971      return $category_ids;
972  }
publicget_category_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
973  public function get_category_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
974  {
975      $ids = $this->get_category_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
976      $objects = array();
977      foreach ($ids as $index=>$id)
978      {
979          $objects[$index] = new category($id);
980      }
981      return $objects;
982  }
publicget_classname ( )[ obj ]
Parameters
No parameters for this method
Code
086  public function get_classname()
087  {
088      return get_class($this);
089  }
public staticget_columns ( columns , order , lookups , where_clause , limit , offset [0] )[ article_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
229  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
230  {
231      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
232      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
233      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
234 
235      $db = article::db();
236      $data = array();
237      $q  = " SELECT $colstring ";
238      $q .= " FROM cms_article ";
239      $q .= " INNER JOIN cms_content ON cms_article.content_id=cms_content.id ";
240      $q .= array_key_exists("content_type_id",$lookups) ? " AND cms_content.content_type_id='" . $lookups["content_type_id"] . "' " : "";
241      $q .= " WHERE cms_article.deleted = 0 ";
242      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
243      $q .= array_key_exists("articlestatus_id",$lookups) ? " AND cms_article.articlestatus_id='" . $lookups["articlestatus_id"] . "' " : "";
244      $q .= array_key_exists("article_type_id",$lookups) ? " AND cms_article.article_type_id='" . $lookups["article_type_id"] . "' " : "";
245 
246      if (is_string($__order))
247      {
248          $q .= "ORDER BY " . $__order;
249      }
250      else if (is_array($__order) and count($__order)>0)
251      {
252          $orderings = array();
253          foreach ($__order as $col=>$dir)
254          {
255              $orderings[] = " $col $dir ";
256          }
257          $q .= "ORDER BY " . implode(", ", $orderings);
258      }
259      else if (is_object($__order))
260      {
261          $q .= "";
262      }
263      else
264      {
265          // THERE IS NO `order` COLUMN ON THIS OBJECT
266      }
267 
268      if (!is_null($__limit))
269      {
270          $q .= " LIMIT $__offset , $__limit ";
271      }
272 
273      $db->query($q);
274 
275      if (count($colarray)>1 || $colstring=="*")
276      {
277          while ($db->next_record())
278          {
279              $data[] = $db->record;
280          }
281      }
282      else
283      {
284          while ($db->next_record())
285          {
286              $data[] = $db->f(0);
287          }
288      }
289 
290      return $data;
291  }
publicget_comment ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
1145  public function get_comment($__type="default")
1146  {
1147      $object = is_null(keyval($this->property_objects_array,"{$__type}_comment")) ? new comment($this->get_comment_id($__type)) : $this->property_objects_array["{$__type}_comment"];
1148      $this->property_objects_array["{$__type}_comment"] = $object;
1149      return $object;
1150  }
publicget_comment_id ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
1151  public function get_comment_id($__type="default")
1152  {
1153      $ids = $this->get_comment_ids($__type, true);
1154      return (count($ids)==1 ? $ids[0] : null);
1155  }
publicget_comment_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1156  public function get_comment_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1157  {
1158      $comment_ids = array();
1159      $db = content::db();
1160      $q  = " SELECT cor_comment.id FROM cms_comment_content INNER JOIN cor_comment ON cms_comment_content.comment_id=cor_comment.id AND cms_comment_content.deleted=0 AND cor_comment.deleted=0 AND cms_comment_content.content_id='$this->id' " . (is_null($__type) ? "" : " AND cms_comment_content.comment_content_type_id='" . comment_content::type_id($__type) . "'") . ($__get_primary ? " AND cms_comment_content.primary=1 " : "");
1161      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1162      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1163      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1164      $db->query($q);
1165      while ($db->next_record())
1166      {
1167          $comment_ids[] = $db->f("id");
1168      }
1169      return $comment_ids;
1170  }
publicget_comment_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1171  public function get_comment_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1172  {
1173      $ids = $this->get_comment_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1174      $objects = array();
1175      foreach ($ids as $index=>$id)
1176      {
1177          $objects[$index] = new comment($id);
1178      }
1179      return $objects;
1180  }
publicget_content ( )[ article_db ]
Parameters
No parameters for this method
Code
389  public function get_content()
390  {
391      return new content($this->content_id);
392  }
publicget_content_type ( )[ content_db ]
Parameters
No parameters for this method
Code
341  public function get_content_type()
342  {
343      return new content_type($this->content_type_id);
344  }
publicget_contentdate ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
748  public function get_contentdate($__type="default")
749  {
750      $object = is_null(keyval($this->property_objects_array,"{$__type}_contentdate")) ? new contentdate($this->get_contentdate_id($__type)) : $this->property_objects_array["{$__type}_contentdate"];
751      $this->property_objects_array["{$__type}_contentdate"] = $object;
752      return $object;
753  }
publicget_contentdate_id ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
754  public function get_contentdate_id($__type="default")
755  {
756      $ids = $this->get_contentdate_ids($__type, true);
757      return (count($ids)==1 ? $ids[0] : null);
758  }
publicget_contentdate_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
759  public function get_contentdate_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
760  {
761      $contentdate_ids = array();
762      $db = content::db();
763      $q  = " SELECT cms_contentdate.id FROM cms_content_contentdate INNER JOIN cms_contentdate ON cms_content_contentdate.contentdate_id=cms_contentdate.id AND cms_content_contentdate.deleted=0 AND cms_contentdate.deleted=0 AND cms_content_contentdate.content_id='$this->id' " . (is_null($__type) ? "" : " AND cms_content_contentdate.content_contentdate_type_id='" . content_contentdate::type_id($__type) . "'") . ($__get_primary ? " AND cms_content_contentdate.primary=1 " : "");
764      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
765      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
766      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
767      $db->query($q);
768      while ($db->next_record())
769      {
770          $contentdate_ids[] = $db->f("id");
771      }
772      return $contentdate_ids;
773  }
publicget_contentdate_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
774  public function get_contentdate_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
775  {
776      $ids = $this->get_contentdate_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
777      $objects = array();
778      foreach ($ids as $index=>$id)
779      {
780          $objects[$index] = new contentdate($id);
781      }
782      return $objects;
783  }
publicget_dirty ( )[ obj ]
Parameters
No parameters for this method
Code
063  public function get_dirty()
064  {
065      if ($this->id === 0)
066      {
067          $this->_dirty = true;
068      }
069      else
070      {
071          foreach (get_object_vars($this) as $k=>$v)
072          {
073              if ($this->_dirty)
074              {
075                  break;
076              }
077              if (preg_match('/_dirty$/',$k))
078              {
079                  $this->_dirty = $this->_dirty || $v;
080              }
081          }
082      }
083      return $this->_dirty;
084  }
publicget_group ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
452  public function get_group($__type="default")
453  {
454      $object = is_null(keyval($this->property_objects_array,"{$__type}_group")) ? new group($this->get_group_id($__type)) : $this->property_objects_array["{$__type}_group"];
455      $this->property_objects_array["{$__type}_group"] = $object;
456      return $object;
457  }
publicget_group_id ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
458  public function get_group_id($__type="default")
459  {
460      $ids = $this->get_group_ids($__type, true);
461      return (count($ids)==1 ? $ids[0] : null);
462  }
publicget_group_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
463  public function get_group_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
464  {
465      $group_ids = array();
466      $db = content::db();
467      $q  = " SELECT cor_group.id FROM cms_content_group INNER JOIN cor_group ON cms_content_group.group_id=cor_group.id AND cms_content_group.deleted=0 AND cor_group.deleted=0 AND cms_content_group.content_id='$this->id' " . (is_null($__type) ? "" : " AND cms_content_group.content_group_type_id='" . content_group::type_id($__type) . "'") . ($__get_primary ? " AND cms_content_group.primary=1 " : "");
468      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
469      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
470      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
471      $db->query($q);
472      while ($db->next_record())
473      {
474          $group_ids[] = $db->f("id");
475      }
476      return $group_ids;
477  }
publicget_group_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
478  public function get_group_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
479  {
480      $ids = $this->get_group_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
481      $objects = array();
482      foreach ($ids as $index=>$id)
483      {
484          $objects[$index] = new group($id);
485      }
486      return $objects;
487  }
public staticget_ids ( order , lookups , where_clause , limit , offset [0] )[ article_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
293  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
294  {
295      return article::get_columns("content_id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
296  }
publicget_json ( )[ obj ]
Parameters
No parameters for this method
Code
101  public function get_json()
102  {
103      $class = new ReflectionClass($this->classname);
104      $methods = $class->getMethods();
105      usort($methods,"sort_reflection_objects");
106      $accessors = array();
107      foreach ($methods as $index=>$method)
108      {
109          $declarer = $method->getDeclaringClass()->name;
110          if (preg_match('/^(get|set|)_(.+)$/',$method->name,$matches))
111          {
112              $accessor = $matches[2];
113              $getset = $matches[1];
114              eval("\$accessors[\$accessor] = \$this->".$accessor.";");
115          }
116      }
117      //return json_encode($this->get_array());
118      return json_encode($accessors);
119  }
public staticget_objects ( order , lookups , where_clause , limit , offset [0] )[ article_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
298  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
299  {
300      $objects = array();
301      foreach (article::get_columns("content_id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
302      {
303          $objects[] = new article($id);
304      }
305      return $objects;
306  }
publicget_page ( type ["default"] )[ article_db ]
Parameters
optionaltype ["default"]
Code
425  public function get_page($__type="default")
426  {
427      $object = is_null(keyval($this->property_objects_array,"{$__type}_page")) ? new page($this->get_page_id($__type)) : $this->property_objects_array["{$__type}_page"];
428      $this->property_objects_array["{$__type}_page"] = $object;
429      return $object;
430  }
publicget_page_id ( type ["default"] )[ article_db ]
Parameters
optionaltype ["default"]
Code
431  public function get_page_id($__type="default")
432  {
433      $ids = $this->get_page_ids($__type, true);
434      return (count($ids)==1 ? $ids[0] : null);
435  }
publicget_page_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ article_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
436  public function get_page_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
437  {
438      $page_ids = array();
439      $db = article::db();
440      $q  = " SELECT cor_page.id FROM cms_article_page INNER JOIN cor_page ON cms_article_page.page_id=cor_page.id AND cms_article_page.deleted=0 AND cor_page.deleted=0 AND cms_article_page.article_content_id='$this->id' " . (is_null($__type) ? "" : " AND cms_article_page.article_page_type_id='" . article_page::type_id($__type) . "'") . ($__get_primary ? " AND cms_article_page.primary=1 " : "");
441      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
442      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
443      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
444      $db->query($q);
445      while ($db->next_record())
446      {
447          $page_ids[] = $db->f("id");
448      }
449      return $page_ids;
450  }
publicget_page_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ article_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
451  public function get_page_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
452  {
453      $ids = $this->get_page_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
454      $objects = array();
455      foreach ($ids as $index=>$id)
456      {
457          $objects[$index] = new page($id);
458      }
459      return $objects;
460  }
publicget_properties ( )[ obj ]
Parameters
No parameters for this method
Code
121  public function get_properties()
122  {
123      return array_keys($this->array);
124  }
publicget_resource ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
846  public function get_resource($__type="default")
847  {
848      $object = is_null(keyval($this->property_objects_array,"{$__type}_resource")) ? new resource($this->get_resource_id($__type)) : $this->property_objects_array["{$__type}_resource"];
849      $this->property_objects_array["{$__type}_resource"] = $object;
850      return $object;
851  }
publicget_resource_id ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
852  public function get_resource_id($__type="default")
853  {
854      $ids = $this->get_resource_ids($__type, true);
855      return (count($ids)==1 ? $ids[0] : null);
856  }
publicget_resource_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
857  public function get_resource_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
858  {
859      $resource_ids = array();
860      $db = content::db();
861      $q  = " SELECT cor_resource.id FROM cms_content_resource INNER JOIN cor_resource ON cms_content_resource.resource_id=cor_resource.id AND cms_content_resource.deleted=0 AND cor_resource.deleted=0 AND cms_content_resource.content_id='$this->id' " . (is_null($__type) ? "" : " AND cms_content_resource.content_resource_type_id='" . content_resource::type_id($__type) . "'") . ($__get_primary ? " AND cms_content_resource.primary=1 " : "");
862      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
863      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
864      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
865      $db->query($q);
866      while ($db->next_record())
867      {
868          $resource_ids[] = $db->f("id");
869      }
870      return $resource_ids;
871  }
publicget_resource_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
872  public function get_resource_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
873  {
874      $ids = $this->get_resource_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
875      $objects = array();
876      foreach ($ids as $index=>$id)
877      {
878          $objects[$index] = new resource($id);
879      }
880      return $objects;
881  }
publicget_seo_title ( )[ article_ext ]
Parameters
No parameters for this method
Code
007  public function get_seo_title()
008  {
009      return str_replace(" ","-",$this->title);
010  }
protectedget_string ( )[ obj ]
Parameters
No parameters for this method
Code
091  protected function get_string()
092  {
093      return method_exists($this,"__toString") ? $this->__toString() : null;
094  }
publicget_tag ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
1046  public function get_tag($__type="default")
1047  {
1048      $object = is_null(keyval($this->property_objects_array,"{$__type}_tag")) ? new tag($this->get_tag_id($__type)) : $this->property_objects_array["{$__type}_tag"];
1049      $this->property_objects_array["{$__type}_tag"] = $object;
1050      return $object;
1051  }
publicget_tag_id ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
1052  public function get_tag_id($__type="default")
1053  {
1054      $ids = $this->get_tag_ids($__type, true);
1055      return (count($ids)==1 ? $ids[0] : null);
1056  }
publicget_tag_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1057  public function get_tag_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1058  {
1059      $tag_ids = array();
1060      $db = content::db();
1061      $q  = " SELECT cms_tag.id FROM cms_content_tag INNER JOIN cms_tag ON cms_content_tag.tag_id=cms_tag.id AND cms_content_tag.deleted=0 AND cms_tag.deleted=0 AND cms_content_tag.content_id='$this->id' " . (is_null($__type) ? "" : " AND cms_content_tag.content_tag_type_id='" . content_tag::type_id($__type) . "'") . ($__get_primary ? " AND cms_content_tag.primary=1 " : "");
1062      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
1063      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
1064      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
1065      $db->query($q);
1066      while ($db->next_record())
1067      {
1068          $tag_ids[] = $db->f("id");
1069      }
1070      return $tag_ids;
1071  }
publicget_tag_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
1072  public function get_tag_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
1073  {
1074      $ids = $this->get_tag_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
1075      $objects = array();
1076      foreach ($ids as $index=>$id)
1077      {
1078          $objects[$index] = new tag($id);
1079      }
1080      return $objects;
1081  }
publicget_type ( )[ article_db ]
Parameters
No parameters for this method
Code
378  public function get_type()
379  {
380      $type = new article_type($this->_article_type_id);
381      return $type->name;
382  }
publicget_url ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
650  public function get_url($__type="default")
651  {
652      $object = is_null(keyval($this->property_objects_array,"{$__type}_url")) ? new url($this->get_url_id($__type)) : $this->property_objects_array["{$__type}_url"];
653      $this->property_objects_array["{$__type}_url"] = $object;
654      return $object;
655  }
publicget_url_id ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
656  public function get_url_id($__type="default")
657  {
658      $ids = $this->get_url_ids($__type, true);
659      return (count($ids)==1 ? $ids[0] : null);
660  }
publicget_url_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
661  public function get_url_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
662  {
663      $url_ids = array();
664      $db = content::db();
665      $q  = " SELECT cor_url.id FROM cms_content_url INNER JOIN cor_url ON cms_content_url.url_id=cor_url.id AND cms_content_url.deleted=0 AND cor_url.deleted=0 AND cms_content_url.content_id='$this->id' " . (is_null($__type) ? "" : " AND cms_content_url.content_url_type_id='" . content_url::type_id($__type) . "'") . ($__get_primary ? " AND cms_content_url.primary=1 " : "");
666      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
667      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
668      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
669      $db->query($q);
670      while ($db->next_record())
671      {
672          $url_ids[] = $db->f("id");
673      }
674      return $url_ids;
675  }
publicget_url_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
676  public function get_url_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
677  {
678      $ids = $this->get_url_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
679      $objects = array();
680      foreach ($ids as $index=>$id)
681      {
682          $objects[$index] = new url($id);
683      }
684      return $objects;
685  }
publicget_user ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
353  public function get_user($__type="default")
354  {
355      $object = is_null(keyval($this->property_objects_array,"{$__type}_user")) ? new user($this->get_user_id($__type)) : $this->property_objects_array["{$__type}_user"];
356      $this->property_objects_array["{$__type}_user"] = $object;
357      return $object;
358  }
publicget_user_id ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
359  public function get_user_id($__type="default")
360  {
361      $ids = $this->get_user_ids($__type, true);
362      return (count($ids)==1 ? $ids[0] : null);
363  }
publicget_user_ids ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
364  public function get_user_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
365  {
366      $user_ids = array();
367      $db = content::db();
368      $q  = " SELECT cor_user.person_entity_id FROM cms_content_user INNER JOIN cor_user ON cms_content_user.user_person_entity_id=cor_user.person_entity_id AND cms_content_user.deleted=0 AND cor_user.deleted=0 AND cms_content_user.content_id='$this->id' " . (is_null($__type) ? "" : " AND cms_content_user.content_user_type_id='" . content_user::type_id($__type) . "'") . ($__get_primary ? " AND cms_content_user.primary=1 " : "");
369      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
370      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
371      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
372      $db->query($q);
373      while ($db->next_record())
374      {
375          $user_ids[] = $db->f("person_entity_id");
376      }
377      return $user_ids;
378  }
publicget_user_list ( type , order , where_clause , limit , offset [0] , get_primary [false] )[ content_db ]
Parameters
optionaltype
optionalorder
optionalwhere_clause
optionallimit
optionaloffset [0]
optionalget_primary [false]
Code
379  public function get_user_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
380  {
381      $ids = $this->get_user_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
382      $objects = array();
383      foreach ($ids as $index=>$id)
384      {
385          $objects[$index] = new user($id);
386      }
387      return $objects;
388  }
protectedinsert ( )[ article_db ]
Parameters
No parameters for this method
Code
147  protected function insert()
148  {
149      parent::insert();
150      $this->_content_id = $this->id;
151      $db = article::db();
152      $q  = " INSERT INTO cms_article ( ";
153      $q .= $db->param_string("content_id") . ", ";
154      $q .= $db->param_string("article_type_id") . ", ";
155      $q .= $db->param_string("title") . ", ";
156      $q .= $db->param_string("sticky") . ", ";
157      $q .= $db->param_string("top") . ", ";
158      $q .= $db->param_string("articlestatus_id") . ", ";
159      $q .= $db->param_string("mdate") . ", ";
160      $q .= $db->param_string("cdate") . ", ";
161      $q .= $db->param_string("deleted");
162      $q .= " ) VALUES ( ";
163      $q .= $db->value_string($this->_content_id) . ", ";
164      $q .= $db->value_string($this->_article_type_id) . ", ";
165      $q .= $db->value_string($this->_title) . ", ";
166      $q .= ($this->_sticky ? "'1'" : "'0'") . ", ";
167      $q .= ($this->_top ? "'1'" : "'0'") . ", ";
168      $q .= $db->value_string($this->_articlestatus_id) . ", ";
169      $q .= $db->value_string(timestamp()) . ", ";
170      $q .= $db->value_string(timestamp()) . ", ";
171      $q .= $this->deleted ? "'1'" : "'0'";
172      $q .= " ) ";
173      $db->query($q);
174      return true;
175  }
publicmap ( )[ article_db ]
Parameters
No parameters for this method
Code
113  public function map()
114  {
115      $this->_data = array_key_exists("article:data",$_REQUEST) ? reqval("article:data") : $this->_data;
116      $this->_summary = array_key_exists("article:summary",$_REQUEST) ? reqval("article:summary") : $this->_summary;
117      $this->_content_type_id = array_key_exists("article:content_type_id",$_REQUEST) ? reqval("article:content_type_id") : $this->_content_type_id;
118      $this->_article_type_id = array_key_exists("article:article_type_id",$_REQUEST) ? reqval("article:article_type_id") : $this->_article_type_id;
119      $this->_title = array_key_exists("article:title",$_REQUEST) ? reqval("article:title") : $this->_title;
120      $this->_sticky = array_key_exists("article:sticky",$_REQUEST) ? reqval("article:sticky") : $this->_sticky;
121      $this->_top = array_key_exists("article:top",$_REQUEST) ? reqval("article:top") : $this->_top;
122      $this->_articlestatus_id = array_key_exists("article:articlestatus_id",$_REQUEST) ? reqval("article:articlestatus_id") : $this->_articlestatus_id;
123      $this->_mdate = array_key_exists("article:mdate",$_REQUEST) ? reqval("article:mdate") : $this->_mdate;
124      $this->_cdate = array_key_exists("article:cdate",$_REQUEST) ? reqval("article:cdate") : $this->_cdate;
125      $this->_deleted = array_key_exists("article:deleted",$_REQUEST) ? reqval("article:deleted") : $this->_deleted;
126  }
publicpurge ( )[ article_db ]
Parameters
No parameters for this method
Code
219  public function purge()
220  {
221      parent::purge();
222      $db = article::db();
223      $q  = " DELETE FROM cms_article ";
224      $q .= " WHERE content_id = " . $this->_content_id;
225      $db->query($q);
226      return true;
227  }
public staticsearch ( keyword )[ article_db ]
public__set ( p , v )[ obj ]
Parameters
requiredp
requiredv
Code
030  public function __set($p,$v)
031  {
032      $methods = get_class_methods($this);
033      $properties = get_object_vars($this);
034      if (in_array("set_$p",$methods))
035      {
036          $this->{"set_$p"}($v);
037      }
038      else if (array_key_exists("_$p",$properties))
039      {
040          if (!preg_match('/_dirty$/',$p) && property_exists($this,"_{$p}_dirty"))
041          {
042              if (is_object($this->{"_$p"}))
043              {
044                  $this->{"_$p"}->dirty = true;
045              }
046              else
047              {
048                  $this->{"_{$p}_dirty"} = $this->{$p}==$v ? false : true;
049              }
050          }
051          $this->{"_$p"} = $v;
052      }
053      else if (in_array("set_" . substr($p,strpos($p,"_")+1), $methods))
054      {
055          $this->{"set_" . substr($p,strpos($p,"_")+1)}($v,substr($p,0,strpos($p,"_")));
056      }
057      else
058      {
059          trigger_error("This object [" . get_class($this) . ":$this->id] has no private property '_$p' for the requested public property '$p'",E_USER_WARNING);
060      }
061  }
publicset_article_type ( v )[ article_db ]
Parameters
requiredv
Code
417  public function set_article_type($v)
418  {
419      if ($v->id > 0)
420      {
421          $this->article_type_id = $v->id;
422      }
423  }
publicset_articlestatus ( v )[ article_db ]
Parameters
requiredv
Code
405  public function set_articlestatus($v)
406  {
407      if ($v->id > 0)
408      {
409          $this->articlestatus_id = $v->id;
410      }
411  }
publicset_category ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
984  public function set_category($__v, $__type="default")
985  {
986      $object = is_null(keyval($this->property_objects_array,"{$__type}_category")) ? new category($this->get_category_id($__type)) : $this->property_objects_array["{$__type}_category"];
987      if (is_null($__v))
988      {
989          $rel = new category_content(null,$object->id,$this->id,category_content::type_id($__type));
990          $rel->delete();
991          if (!is_null(keyval($this->property_objects_array,"{$__type}_category")))
992          {
993              $this->property_objects_array["{$__type}_category"] = null;
994          }
995      }
996      else
997      {
998          $id = $object->id;
999          $object = $__v;
1000          $object->id = $__v->id>0 ? $__v->id : $id;
1001          $object->commit();
1002          $this->set_category_ids(array($object->id),$__type);
1003      }
1004  }
publicset_category_id ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1005  public function set_category_id($__v, $__type="default")
1006  {
1007      $this->set_category_ids(array($__v),$__type);
1008  }
publicset_category_ids ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1009  public function set_category_ids($__v, $__type="default")
1010  {
1011      if ($this->id == 0)
1012      {
1013          $this->commit();
1014      }
1015      $type_id = category_content::type_id($__type);
1016      category_content::delete_all(null,$this->id,$type_id);
1017      if (is_array($__v))
1018      {
1019          foreach ($__v as $index=>$id)
1020          {
1021              $object = new category_content(null,$id,$this->id,$type_id);
1022              $object->deleted = false;
1023              $object->category_content_type_id = $type_id;
1024              $object->commit();
1025              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_category")))
1026              {
1027                  $this->property_objects_array["{$__type}_category"] = new category($object->category_id);
1028              }
1029          }
1030          $this->_dirty = true;
1031      }
1032  }
publicset_category_list ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1033  public function set_category_list($__v, $__type="default")
1034  {
1035      if (is_array($__v))
1036      {
1037          $ids = array();
1038          foreach ($__v as $index=>$object)
1039          {
1040              $ids[] = $object->id;
1041          }
1042          $this->set_category_ids($ids,$__type);
1043      }
1044  }
publicset_comment ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1182  public function set_comment($__v, $__type="default")
1183  {
1184      $object = is_null(keyval($this->property_objects_array,"{$__type}_comment")) ? new comment($this->get_comment_id($__type)) : $this->property_objects_array["{$__type}_comment"];
1185      if (is_null($__v))
1186      {
1187          $rel = new comment_content(null,$object->id,$this->id,comment_content::type_id($__type));
1188          $rel->delete();
1189          if (!is_null(keyval($this->property_objects_array,"{$__type}_comment")))
1190          {
1191              $this->property_objects_array["{$__type}_comment"] = null;
1192          }
1193      }
1194      else
1195      {
1196          $id = $object->id;
1197          $object = $__v;
1198          $object->id = $__v->id>0 ? $__v->id : $id;
1199          $object->commit();
1200          $this->set_comment_ids(array($object->id),$__type);
1201      }
1202  }
publicset_comment_id ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1203  public function set_comment_id($__v, $__type="default")
1204  {
1205      $this->set_comment_ids(array($__v),$__type);
1206  }
publicset_comment_ids ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1207  public function set_comment_ids($__v, $__type="default")
1208  {
1209      if ($this->id == 0)
1210      {
1211          $this->commit();
1212      }
1213      $type_id = comment_content::type_id($__type);
1214      comment_content::delete_all(null,$this->id,$type_id);
1215      if (is_array($__v))
1216      {
1217          foreach ($__v as $index=>$id)
1218          {
1219              $object = new comment_content(null,$id,$this->id,$type_id);
1220              $object->deleted = false;
1221              $object->comment_content_type_id = $type_id;
1222              $object->commit();
1223              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_comment")))
1224              {
1225                  $this->property_objects_array["{$__type}_comment"] = new comment($object->comment_id);
1226              }
1227          }
1228          $this->_dirty = true;
1229      }
1230  }
publicset_comment_list ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1231  public function set_comment_list($__v, $__type="default")
1232  {
1233      if (is_array($__v))
1234      {
1235          $ids = array();
1236          foreach ($__v as $index=>$object)
1237          {
1238              $ids[] = $object->id;
1239          }
1240          $this->set_comment_ids($ids,$__type);
1241      }
1242  }
publicset_content ( v )[ article_db ]
Parameters
requiredv
Code
393  public function set_content($v)
394  {
395      if ($v->id > 0)
396      {
397          $this->content_id = $v->id;
398      }
399  }
publicset_content_type ( v )[ content_db ]
Parameters
requiredv
Code
345  public function set_content_type($v)
346  {
347      if ($v->id > 0)
348      {
349          $this->content_type_id = $v->id;
350      }
351  }
publicset_contentdate ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
785  public function set_contentdate($__v, $__type="default")
786  {
787      $object = is_null(keyval($this->property_objects_array,"{$__type}_contentdate")) ? new contentdate($this->get_contentdate_id($__type)) : $this->property_objects_array["{$__type}_contentdate"];
788      if (is_null($__v))
789      {
790          $rel = new content_contentdate(null,$this->id,$object->id,content_contentdate::type_id($__type));
791          $rel->delete();
792          $object->delete();
793          if (!is_null(keyval($this->property_objects_array,"{$__type}_contentdate")))
794          {
795              $this->property_objects_array["{$__type}_contentdate"] = null;
796          }
797      }
798      else
799      {
800          $object->value = is_object($__v) ? $__v->value : $__v;
801          $object->commit();
802          $this->set_contentdate_ids(array($object->id),$__type);
803      }
804  }
publicset_contentdate_id ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
805  public function set_contentdate_id($__v, $__type="default")
806  {
807      $this->set_contentdate_ids(array($__v),$__type);
808  }
publicset_contentdate_ids ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
809  public function set_contentdate_ids($__v, $__type="default")
810  {
811      if ($this->id == 0)
812      {
813          $this->commit();
814      }
815      $type_id = content_contentdate::type_id($__type);
816      content_contentdate::delete_all($this->id,null,$type_id);
817      if (is_array($__v))
818      {
819          foreach ($__v as $index=>$id)
820          {
821              $object = new content_contentdate(null,$this->id,$id,$type_id);
822              $object->deleted = false;
823              $object->content_contentdate_type_id = $type_id;
824              $object->commit();
825              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_contentdate")))
826              {
827                  $this->property_objects_array["{$__type}_contentdate"] = new contentdate($object->contentdate_id);
828              }
829          }
830          $this->_dirty = true;
831      }
832  }
publicset_contentdate_list ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
833  public function set_contentdate_list($__v, $__type="default")
834  {
835      if (is_array($__v))
836      {
837          $ids = array();
838          foreach ($__v as $index=>$object)
839          {
840              $ids[] = $object->id;
841          }
842          $this->set_contentdate_ids($ids,$__type);
843      }
844  }
publicset_group ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
489  public function set_group($__v, $__type="default")
490  {
491      $object = is_null(keyval($this->property_objects_array,"{$__type}_group")) ? new group($this->get_group_id($__type)) : $this->property_objects_array["{$__type}_group"];
492      if (is_null($__v))
493      {
494          $rel = new content_group(null,$this->id,$object->id,content_group::type_id($__type));
495          $rel->delete();
496          if (!is_null(keyval($this->property_objects_array,"{$__type}_group")))
497          {
498              $this->property_objects_array["{$__type}_group"] = null;
499          }
500      }
501      else
502      {
503          $id = $object->id;
504          $object = $__v;
505          $object->id = $__v->id>0 ? $__v->id : $id;
506          $object->commit();
507          $this->set_group_ids(array($object->id),$__type);
508      }
509  }
publicset_group_id ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
510  public function set_group_id($__v, $__type="default")
511  {
512      $this->set_group_ids(array($__v),$__type);
513  }
publicset_group_ids ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
514  public function set_group_ids($__v, $__type="default")
515  {
516      if ($this->id == 0)
517      {
518          $this->commit();
519      }
520      $type_id = content_group::type_id($__type);
521      content_group::delete_all($this->id,null,$type_id);
522      if (is_array($__v))
523      {
524          foreach ($__v as $index=>$id)
525          {
526              $object = new content_group(null,$this->id,$id,$type_id);
527              $object->deleted = false;
528              $object->content_group_type_id = $type_id;
529              $object->commit();
530              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_group")))
531              {
532                  $this->property_objects_array["{$__type}_group"] = new group($object->group_id);
533              }
534          }
535          $this->_dirty = true;
536      }
537  }
publicset_group_list ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
538  public function set_group_list($__v, $__type="default")
539  {
540      if (is_array($__v))
541      {
542          $ids = array();
543          foreach ($__v as $index=>$object)
544          {
545              $ids[] = $object->id;
546          }
547          $this->set_group_ids($ids,$__type);
548      }
549  }
publicset_page ( v , type ["default"] )[ article_db ]
Parameters
requiredv
optionaltype ["default"]
Code
462  public function set_page($__v, $__type="default")
463  {
464      $object = is_null(keyval($this->property_objects_array,"{$__type}_page")) ? new page($this->get_page_id($__type)) : $this->property_objects_array["{$__type}_page"];
465      if (is_null($__v))
466      {
467          $rel = new article_page(null,$this->id,$object->id,article_page::type_id($__type));
468          $rel->delete();
469          if (!is_null(keyval($this->property_objects_array,"{$__type}_page")))
470          {
471              $this->property_objects_array["{$__type}_page"] = null;
472          }
473      }
474      else
475      {
476          $id = $object->id;
477          $object = $__v;
478          $object->id = $__v->id>0 ? $__v->id : $id;
479          $object->commit();
480          $this->set_page_ids(array($object->id),$__type);
481      }
482  }
publicset_page_id ( v , type ["default"] )[ article_db ]
Parameters
requiredv
optionaltype ["default"]
Code
483  public function set_page_id($__v, $__type="default")
484  {
485      $this->set_page_ids(array($__v),$__type);
486  }
publicset_page_ids ( v , type ["default"] )[ article_db ]
Parameters
requiredv
optionaltype ["default"]
Code
487  public function set_page_ids($__v, $__type="default")
488  {
489      if ($this->id == 0)
490      {
491          $this->commit();
492      }
493      $type_id = article_page::type_id($__type);
494      article_page::delete_all($this->id,null,$type_id);
495      if (is_array($__v))
496      {
497          foreach ($__v as $index=>$id)
498          {
499              $object = new article_page(null,$this->id,$id,$type_id);
500              $object->deleted = false;
501              $object->article_page_type_id = $type_id;
502              $object->commit();
503              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_page")))
504              {
505                  $this->property_objects_array["{$__type}_page"] = new page($object->page_id);
506              }
507          }
508          $this->_dirty = true;
509      }
510  }
publicset_page_list ( v , type ["default"] )[ article_db ]
Parameters
requiredv
optionaltype ["default"]
Code
511  public function set_page_list($__v, $__type="default")
512  {
513      if (is_array($__v))
514      {
515          $ids = array();
516          foreach ($__v as $index=>$object)
517          {
518              $ids[] = $object->id;
519          }
520          $this->set_page_ids($ids,$__type);
521      }
522  }
publicset_resource ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
883  public function set_resource($__v, $__type="default")
884  {
885      $object = is_null(keyval($this->property_objects_array,"{$__type}_resource")) ? new resource($this->get_resource_id($__type)) : $this->property_objects_array["{$__type}_resource"];
886      if (is_null($__v))
887      {
888          $rel = new content_resource(null,$this->id,$object->id,content_resource::type_id($__type));
889          $rel->delete();
890          if (!is_null(keyval($this->property_objects_array,"{$__type}_resource")))
891          {
892              $this->property_objects_array["{$__type}_resource"] = null;
893          }
894      }
895      else
896      {
897          $hash = $object->hash;
898          $id = $object->id;
899          $object = $__v;
900          $object->hash = $__v->id>0 ? $__v->hash : $hash;
901          $object->id = $__v->id>0 ? $__v->id : $id;
902          $object->commit();
903          $this->set_resource_ids(array($object->id),$__type);
904      }
905  }
publicset_resource_id ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
906  public function set_resource_id($__v, $__type="default")
907  {
908      $this->set_resource_ids(array($__v),$__type);
909  }
publicset_resource_ids ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
910  public function set_resource_ids($__v, $__type="default")
911  {
912      if ($this->id == 0)
913      {
914          $this->commit();
915      }
916      $type_id = content_resource::type_id($__type);
917      content_resource::delete_all($this->id,null,$type_id);
918      if (is_array($__v))
919      {
920          foreach ($__v as $index=>$id)
921          {
922              $object = new content_resource(null,$this->id,$id,$type_id);
923              $object->deleted = false;
924              $object->content_resource_type_id = $type_id;
925              $object->commit();
926              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_resource")))
927              {
928                  $this->property_objects_array["{$__type}_resource"] = new resource($object->resource_id);
929              }
930          }
931          $this->_dirty = true;
932      }
933  }
publicset_resource_list ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
934  public function set_resource_list($__v, $__type="default")
935  {
936      if (is_array($__v))
937      {
938          $ids = array();
939          foreach ($__v as $index=>$object)
940          {
941              $ids[] = $object->id;
942          }
943          $this->set_resource_ids($ids,$__type);
944      }
945  }
publicset_tag ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1083  public function set_tag($__v, $__type="default")
1084  {
1085      $object = is_null(keyval($this->property_objects_array,"{$__type}_tag")) ? new tag($this->get_tag_id($__type)) : $this->property_objects_array["{$__type}_tag"];
1086      if (is_null($__v))
1087      {
1088          $rel = new content_tag(null,$this->id,$object->id,content_tag::type_id($__type));
1089          $rel->delete();
1090          if (!is_null(keyval($this->property_objects_array,"{$__type}_tag")))
1091          {
1092              $this->property_objects_array["{$__type}_tag"] = null;
1093          }
1094      }
1095      else
1096      {
1097          $id = $object->id;
1098          $object = $__v;
1099          $object->id = $__v->id>0 ? $__v->id : $id;
1100          $object->commit();
1101          $this->set_tag_ids(array($object->id),$__type);
1102      }
1103  }
publicset_tag_id ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1104  public function set_tag_id($__v, $__type="default")
1105  {
1106      $this->set_tag_ids(array($__v),$__type);
1107  }
publicset_tag_ids ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1108  public function set_tag_ids($__v, $__type="default")
1109  {
1110      if ($this->id == 0)
1111      {
1112          $this->commit();
1113      }
1114      $type_id = content_tag::type_id($__type);
1115      content_tag::delete_all($this->id,null,$type_id);
1116      if (is_array($__v))
1117      {
1118          foreach ($__v as $index=>$id)
1119          {
1120              $object = new content_tag(null,$this->id,$id,$type_id);
1121              $object->deleted = false;
1122              $object->content_tag_type_id = $type_id;
1123              $object->commit();
1124              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_tag")))
1125              {
1126                  $this->property_objects_array["{$__type}_tag"] = new tag($object->tag_id);
1127              }
1128          }
1129          $this->_dirty = true;
1130      }
1131  }
publicset_tag_list ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
1132  public function set_tag_list($__v, $__type="default")
1133  {
1134      if (is_array($__v))
1135      {
1136          $ids = array();
1137          foreach ($__v as $index=>$object)
1138          {
1139              $ids[] = $object->id;
1140          }
1141          $this->set_tag_ids($ids,$__type);
1142      }
1143  }
publicset_type ( v )[ article_db ]
Parameters
requiredv
Code
383  public function set_type($v)
384  {
385      $type = new article_type(null, $v);
386      $this->article_type_id = $type->id;
387  }
publicset_url ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
687  public function set_url($__v, $__type="default")
688  {
689      $object = is_null(keyval($this->property_objects_array,"{$__type}_url")) ? new url($this->get_url_id($__type)) : $this->property_objects_array["{$__type}_url"];
690      if (is_null($__v))
691      {
692          $rel = new content_url(null,$this->id,$object->id,content_url::type_id(