Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Class Reference

class content extends content_ext

Hide Inherited MembersContent Management
Description
No description.
 
Constants
constantTABLENAME ["cms_content"][ content ]
 
Properties
protected_cdate[ content_db ]
protected_cdate_dirty[ content_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[ content_db ]
protected_deleted_dirty[ content_db ]
protected_dirty[ obj ]
protected_id[ content_db ]
protected_id_dirty[ content_db ]
protected_mdate[ content_db ]
protected_mdate_dirty[ content_db ]
publicproperty_objects_array[ obj ]
protected_summary[ content_db ]
protected_summary_dirty[ content_db ]
 
Methods
publiccommit ( )[ content_db ]
Parameters
No parameters for this method
Code
098  public function commit()
099  {
100      if ($this->_id > 0)
101      {
102          $this->update();
103      }
104      else
105      {
106          $this->insert();
107      }
108 
109      foreach ($this->property_objects_array as $property=>$object)
110      {
111          $this->{$property} = $object;
112      }
113 
114      return true;
115  }
public__construct ( id )[ content_db ]
Parameters
optionalid
Code
044  public function __construct($__id=null)
045  {
046      $this->_id = 0;
047      $this->_data = "";
048      $this->_summary = "";
049      $this->_content_type_id = 0;
050      $this->_mdate = null;
051      $this->_cdate = null;
052      $this->_deleted = false;
053 
054      $this->_id_dirty = false;
055      $this->_data_dirty = false;
056      $this->_summary_dirty = false;
057      $this->_content_type_id_dirty = false;
058      $this->_mdate_dirty = false;
059      $this->_cdate_dirty = false;
060      $this->_deleted_dirty = false;
061 
062      if (is_null($__id))
063      {
064          return;
065      }
066 
067      $db = content::db();
068      $q  = " SELECT cms_content.id,cms_content.data,cms_content.summary,cms_content.content_type_id,cms_content.mdate,cms_content.cdate,cms_content.deleted ";
069      $q .= " FROM cms_content ";       
070      if (!is_null($__id))
071      {
072          $q .= " WHERE id = '$__id' ";
073      }
074 
075      $db->query($q);
076      if ($db->next_record() && $db->num_rows() == 1)
077      {
078          $this->_id = $db->f("id");
079          $this->_data = $db->f("data");
080          $this->_summary = $db->f("summary");
081          $this->_content_type_id = $db->f("content_type_id");
082          $this->_mdate = $db->f("mdate");
083          $this->_cdate = $db->f("cdate");
084          $this->_deleted = $db->f("deleted");
085      }
086  }
protected staticdb ( )[ content_db ]
Parameters
No parameters for this method
Code
1244  protected static function db()
1245  {
1246      return new db();
1247  }
publicdelete ( )[ content_db ]
Parameters
No parameters for this method
Code
154  public function delete()
155  {
156      $db = content::db();
157      $q  = " UPDATE cms_content SET ";
158      $q .= " deleted = 1 ";
159      $q .= " WHERE id = " . $this->_id;
160      $db->query($q);
161      $this->deleted = true;
162      return true;
163  }
public staticdelete_all ( )[ content_db ]
Parameters
No parameters for this method
Code
261  public static function delete_all()
262  {
263      $db = content::db();
264      $q  = " UPDATE cms_content SET ";
265      $q .= " deleted = 1 ";
266     
267      $db->query($q);
268      return true;
269  }
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_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] )[ content_db ]
Parameters
requiredcolumns
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
185  public static function get_columns($__columns, $__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
186  {
187      $lookups = is_array($__lookups) ? $__lookups : array($__lookups);
188      $colarray = is_array($__columns) ? $__columns : explode(",",$__columns);
189      $colstring = is_array($__columns) ? implode(",",$__columns) : $__columns;
190 
191      $db = content::db();
192      $data = array();
193      $q  = " SELECT $colstring ";
194      $q .= " FROM cms_content ";
195      $q .= " WHERE cms_content.deleted = 0 ";
196      $q .= is_null($__where_clause) ? null : " AND ($__where_clause) ";
197      $q .= array_key_exists("content_type_id",$lookups) ? " AND cms_content.content_type_id='" . $lookups["content_type_id"] . "' " : "";
198 
199      if (is_string($__order))
200      {
201          $q .= "ORDER BY " . $__order;
202      }
203      else if (is_array($__order) and count($__order)>0)
204      {
205          $orderings = array();
206          foreach ($__order as $col=>$dir)
207          {
208              $orderings[] = " $col $dir ";
209          }
210          $q .= "ORDER BY " . implode(", ", $orderings);
211      }
212      else if (is_object($__order))
213      {
214          $q .= "";
215      }
216      else
217      {
218          // THERE IS NO `order` COLUMN ON THIS OBJECT
219      }
220 
221      if (!is_null($__limit))
222      {
223          $q .= " LIMIT $__offset , $__limit ";
224      }
225 
226      $db->query($q);
227 
228      if (count($colarray)>1 || $colstring=="*")
229      {
230          while ($db->next_record())
231          {
232              $data[] = $db->record;
233          }
234      }
235      else
236      {
237          while ($db->next_record())
238          {
239              $data[] = $db->f(0);
240          }
241      }
242 
243      return $data;
244  }
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_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] )[ content_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
246  public static function get_ids($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
247  {
248      return content::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset);
249  }
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] )[ content_db ]
Parameters
optionalorder
optionallookups
optionalwhere_clause
optionallimit
optionaloffset [0]
Code
251  public static function get_objects($__order=null, $__lookups=null, $__where_clause=null, $__limit=null, $__offset=0)
252  {
253      $objects = array();
254      foreach (content::get_columns("id", $__order, $__lookups, $__where_clause, $__limit, $__offset) as $id)
255      {
256          $objects[] = new content($id);
257      }
258      return $objects;
259  }
publicget_page ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
551  public function get_page($__type="default")
552  {
553      $object = is_null(keyval($this->property_objects_array,"{$__type}_page")) ? new page($this->get_page_id($__type)) : $this->property_objects_array["{$__type}_page"];
554      $this->property_objects_array["{$__type}_page"] = $object;
555      return $object;
556  }
publicget_page_id ( type ["default"] )[ content_db ]
Parameters
optionaltype ["default"]
Code
557  public function get_page_id($__type="default")
558  {
559      $ids = $this->get_page_ids($__type, true);
560      return (count($ids)==1 ? $ids[0] : null);
561  }
publicget_page_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
562  public function get_page_ids($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
563  {
564      $page_ids = array();
565      $db = content::db();
566      $q  = " SELECT cor_page.id FROM cms_content_page INNER JOIN cor_page ON cms_content_page.page_id=cor_page.id AND cms_content_page.deleted=0 AND cor_page.deleted=0 AND cms_content_page.content_id='$this->id' " . (is_null($__type) ? "" : " AND cms_content_page.content_page_type_id='" . content_page::type_id($__type) . "'") . ($__get_primary ? " AND cms_content_page.primary=1 " : "");
567      $q .= is_null($__where_clause) ? "" : " WHERE {$__where_clause}";
568      $q .= is_null($__order) ? "" : " ORDER BY {$__order}";
569      $q .= is_null($__limit) ? "" : " LIMIT {$__offset}, {$__limit}";
570      $db->query($q);
571      while ($db->next_record())
572      {
573          $page_ids[] = $db->f("id");
574      }
575      return $page_ids;
576  }
publicget_page_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
577  public function get_page_list($__type=null, $__order=null, $__where_clause=null, $__limit=null, $__offset=0, $__get_primary=false)
578  {
579      $ids = $this->get_page_ids($__type, $__order, $__where_clause, $__limit, $__offset, $__get_primary);
580      $objects = array();
581      foreach ($ids as $index=>$id)
582      {
583          $objects[$index] = new page($id);
584      }
585      return $objects;
586  }
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  }
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 ( )[ content_db ]
Parameters
No parameters for this method
Code
330  public function get_type()
331  {
332      $type = new content_type($this->_content_type_id);
333      return $type->name;
334  }
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 ( )[ content_db ]
Parameters
No parameters for this method
Code
117  protected function insert()
118  {
119      $db = content::db();
120      $q  = " INSERT INTO cms_content ( ";
121      $q .= $db->param_string("data") . ", ";
122      $q .= $db->param_string("summary") . ", ";
123      $q .= $db->param_string("content_type_id") . ", ";
124      $q .= $db->param_string("mdate") . ", ";
125      $q .= $db->param_string("cdate") . ", ";
126      $q .= $db->param_string("deleted");
127      $q .= " ) VALUES ( ";
128      $q .= $db->value_string($this->_data) . ", ";
129      $q .= $db->value_string($this->_summary) . ", ";
130      $q .= $db->value_string($this->_content_type_id) . ", ";
131      $q .= $db->value_string(timestamp()) . ", ";
132      $q .= $db->value_string(timestamp()) . ", ";
133      $q .= $this->deleted ? "'1'" : "'0'";
134      $q .= " ) ";
135      $db->query($q);
136      $this->_id = $db->insert_id;
137      return true;
138  }
publicmap ( )[ content_db ]
Parameters
No parameters for this method
Code
088  public function map()
089  {
090      $this->_data = array_key_exists("content:data",$_REQUEST) ? reqval("content:data") : $this->_data;
091      $this->_summary = array_key_exists("content:summary",$_REQUEST) ? reqval("content:summary") : $this->_summary;
092      $this->_content_type_id = array_key_exists("content:content_type_id",$_REQUEST) ? reqval("content:content_type_id") : $this->_content_type_id;
093      $this->_mdate = array_key_exists("content:mdate",$_REQUEST) ? reqval("content:mdate") : $this->_mdate;
094      $this->_cdate = array_key_exists("content:cdate",$_REQUEST) ? reqval("content:cdate") : $this->_cdate;
095      $this->_deleted = array_key_exists("content:deleted",$_REQUEST) ? reqval("content:deleted") : $this->_deleted;
096  }
publicpurge ( )[ content_db ]
Parameters
No parameters for this method
Code
176  public function purge()
177  {
178      $db = content::db();
179      $q  = " DELETE FROM cms_content ";
180      $q .= " WHERE id = " . $this->_id;
181      $db->query($q);
182      return true;
183  }
public staticsearch ( keyword )[ content_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_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_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"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
588  public function set_page($__v, $__type="default")
589  {
590      $object = is_null(keyval($this->property_objects_array,"{$__type}_page")) ? new page($this->get_page_id($__type)) : $this->property_objects_array["{$__type}_page"];
591      if (is_null($__v))
592      {
593          $rel = new content_page(null,$this->id,$object->id,content_page::type_id($__type));
594          $rel->delete();
595          if (!is_null(keyval($this->property_objects_array,"{$__type}_page")))
596          {
597              $this->property_objects_array["{$__type}_page"] = null;
598          }
599      }
600      else
601      {
602          $id = $object->id;
603          $object = $__v;
604          $object->id = $__v->id>0 ? $__v->id : $id;
605          $object->commit();
606          $this->set_page_ids(array($object->id),$__type);
607      }
608  }
publicset_page_id ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
609  public function set_page_id($__v, $__type="default")
610  {
611      $this->set_page_ids(array($__v),$__type);
612  }
publicset_page_ids ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
613  public function set_page_ids($__v, $__type="default")
614  {
615      if ($this->id == 0)
616      {
617          $this->commit();
618      }
619      $type_id = content_page::type_id($__type);
620      content_page::delete_all($this->id,null,$type_id);
621      if (is_array($__v))
622      {
623          foreach ($__v as $index=>$id)
624          {
625              $object = new content_page(null,$this->id,$id,$type_id);
626              $object->deleted = false;
627              $object->content_page_type_id = $type_id;
628              $object->commit();
629              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_page")))
630              {
631                  $this->property_objects_array["{$__type}_page"] = new page($object->page_id);
632              }
633          }
634          $this->_dirty = true;
635      }
636  }
publicset_page_list ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
637  public function set_page_list($__v, $__type="default")
638  {
639      if (is_array($__v))
640      {
641          $ids = array();
642          foreach ($__v as $index=>$object)
643          {
644              $ids[] = $object->id;
645          }
646          $this->set_page_ids($ids,$__type);
647      }
648  }
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 )[ content_db ]
Parameters
requiredv
Code
335  public function set_type($v)
336  {
337      $type = new content_type(null, $v);
338      $this->content_type_id = $type->id;
339  }
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($__type));
693          $rel->delete();
694          $object->delete();
695          if (!is_null(keyval($this->property_objects_array,"{$__type}_url")))
696          {
697              $this->property_objects_array["{$__type}_url"] = null;
698          }
699      }
700      else
701      {
702          $object->value = is_object($__v) ? $__v->value : $__v;
703          $object->commit();
704          $this->set_url_ids(array($object->id),$__type);
705      }
706  }
publicset_url_id ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
707  public function set_url_id($__v, $__type="default")
708  {
709      $this->set_url_ids(array($__v),$__type);
710  }
publicset_url_ids ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
711  public function set_url_ids($__v, $__type="default")
712  {
713      if ($this->id == 0)
714      {
715          $this->commit();
716      }
717      $type_id = content_url::type_id($__type);
718      content_url::delete_all($this->id,null,$type_id);
719      if (is_array($__v))
720      {
721          foreach ($__v as $index=>$id)
722          {
723              $object = new content_url(null,$this->id,$id,$type_id);
724              $object->deleted = false;
725              $object->content_url_type_id = $type_id;
726              $object->commit();
727              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_url")))
728              {
729                  $this->property_objects_array["{$__type}_url"] = new url($object->url_id);
730              }
731          }
732          $this->_dirty = true;
733      }
734  }
publicset_url_list ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
735  public function set_url_list($__v, $__type="default")
736  {
737      if (is_array($__v))
738      {
739          $ids = array();
740          foreach ($__v as $index=>$object)
741          {
742              $ids[] = $object->id;
743          }
744          $this->set_url_ids($ids,$__type);
745      }
746  }
publicset_user ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
390  public function set_user($__v, $__type="default")
391  {
392      $object = is_null(keyval($this->property_objects_array,"{$__type}_user")) ? new user($this->get_user_id($__type)) : $this->property_objects_array["{$__type}_user"];
393      if (is_null($__v))
394      {
395          $rel = new content_user(null,$this->id,$object->id,content_user::type_id($__type));
396          $rel->delete();
397          if (!is_null(keyval($this->property_objects_array,"{$__type}_user")))
398          {
399              $this->property_objects_array["{$__type}_user"] = null;
400          }
401      }
402      else
403      {
404          $id = $object->id;
405          $object = $__v;
406          $object->id = $__v->id>0 ? $__v->id : $id;
407          $object->commit();
408          $this->set_user_ids(array($object->id),$__type);
409      }
410  }
publicset_user_id ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
411  public function set_user_id($__v, $__type="default")
412  {
413      $this->set_user_ids(array($__v),$__type);
414  }
publicset_user_ids ( v , type ["default"] )[ content_db ]
Parameters
requiredv
optionaltype ["default"]
Code
415  public function set_user_ids($__v, $__type="default")
416  {
417      if ($this->id == 0)
418      {
419          $this->commit();
420      }
421      $type_id = content_user::type_id($__type);
422      content_user::delete_all($this->id,null,$type_id);
423      if (is_array($__v))
424      {
425          foreach ($__v as $index=>$id)
426          {
427              $object = new content_user(null,$this->id,$id,$type_id);
428              $object->deleted = false;
429              $object->content_user_type_id = $type_id;
430              $object->commit();
431              if (count($__v)==1 && !is_null(keyval($this->property_objects_array,"{$__type}_user")))
432              {
433                  $this->property_objects_array["{$__type}_user"] = new user($object->user_id);
434              }
435          }
436          $this->_dirty = true;
437      }