phpDocumentor items
[ class tree: items ] [ index: items ] [ all elements ]

Class: ItemLight

Source Location: /qp_inc/items/model/_itemlight.class.php

Class ItemLight

Descendants
Child Class Description
Item Item Class

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From DataObject

DataObject::$delete_cascades
DataObject::$delete_restrictions
DataObject::$ID

Inherited From DataObject

DataObject::DataObject()
Constructor
DataObject::check_delete()
Check relations for restrictions before deleting
DataObject::check_relations()
Check relations for restrictions or cascades
DataObject::confirm_delete()
Displays form to confirm deletion of this object
DataObject::dbchange()
Records a change that will need to be updated in the db
DataObject::dbdelete()
Delete object from DB.
DataObject::dbinsert()
Insert object into DB based on previously recorded changes.
DataObject::dbsave()
Inserts or Updates depending on object state.
DataObject::dbupdate()
Update the DB based on previously recorded changes
DataObject::dget()
Get a ready-to-display member param by its name
DataObject::disp()
Display a member param by its name
DataObject::get()
Get a member param by its name
DataObject::history_info_icon()
Create icon with dataobject history
DataObject::ID()
Template function: Displays object ID.
DataObject::set()
Set param value
DataObject::set_from_Request()
Set a parameter from a Request form value.
DataObject::set_param()
Set param value.

[ Top ]
Property Summary
Blog   $Blog   The Blog of the Item (lazy filled, use get_Blog() to access it.
mixed   $blog_ID  
mixed   $excerpt  
mixed   $extra_cat_IDs  
mixed   $extra_cat_IDs_changed  
mixed   $issue_date  
mixed   $main_cat_ID  
Chapter   $main_Chapter  
mixed   $mod_date  
mixed   $ptyp_ID  
mixed   $title  
mixed   $url  
mixed   $urltitle  

[ Top ]
Method Summary
ItemLight   ItemLight()   Constructor
void   categories()   T-Tag: list all the category names
void   get_archive_url()   Generate a link to the post in the archives
Blog   &get_Blog()   Get the Blog object for the Item.
integer   get_blog_ID()   Get the blog ID of this item (derived from main chapter).
array   get_Chapters()   Get list of Chapter objects.
array   get_Chapter_IDs()   Get the chapter (category) IDs for this item.
void   get_chapter_url()   Generate a link to the post in the category
string   get_excerpt()   Template function: get excerpt
void   get_issue_date()   T-Tag: returns formatted issue date or time (datetime) of Item
Chapter   &get_main_Chapter()   Get the main Chapter.
void   get_permanent_link()   T-Tag: Get the linked permanent url (permalink) for the item
void   get_permanent_url()   Generate the permalink for the item.
array   get_prefetch_itemlist_IDs()   Get a list of item IDs from $MainList and $ItemList, if they are loaded.
void   get_single_url()   Generate a single post link for the item
string   get_title()   Get "nice" title of the Item
void   issue_date()   T-Tag: Display issue date/time of an item
void   issue_time()   T-Tag: Display issue date/time of an item
boolean   is_featured()   T-Tag: Is this a 'featured' post?
boolean   is_intro()   T-Tag: Is this an 'intro' post?
void   lang()   Template function: display locale for item
void   language()   Template function: display language name for item
void   load_Blog()   Load the Blog object for the Item, without returning it.
void   locale()   Template function: display locale for item
void   locale_flag()   T-Tag: Displays or returns an author's locale flag
void   locale_temp_switch()   T-Tag: Temporarily switch to this item's locale
void   main_category()   Template function: display main category name
void   mod_date()   Template function: display last mod date (datetime) of Item
void   mod_time()   Template function: display last mod time (datetime) of Item
void   permanent_link()   T-Tag: Display the linked permanent url (permalink) for the item
void   permanent_url()   Template function: display permalink for item
boolean   set()   Set param value
boolean   set_extracats()   Set the extra categories for this item.
void   title()   T-Tag: Display title for item and link to related URL
void   type()   Template function: display type of item

[ Top ]
Properties
Blog   $Blog [line 55]

The Blog of the Item (lazy filled, use get_Blog() to access it.

API Tags:
See:  Blog::get_Blog()
Access:  protected


[ Top ]
mixed   $blog_ID [line 63]

[ Top ]
mixed   $excerpt [line 67]

[ Top ]
mixed   $extra_cat_IDs = NULL [line 72]

[ Top ]
mixed   $extra_cat_IDs_changed = false [line 73]

[ Top ]
mixed   $issue_date [line 64]

[ Top ]
mixed   $main_cat_ID = 0 [line 71]

[ Top ]
Chapter   $main_Chapter [line 61]
API Tags:
See:  ItemLight::get_main_Chapter()
Access:  protected


[ Top ]
mixed   $mod_date [line 65]

[ Top ]
mixed   $ptyp_ID [line 70]

[ Top ]
mixed   $title [line 66]

[ Top ]
mixed   $url [line 69]

[ Top ]
mixed   $urltitle [line 68]

[ Top ]
Methods
Constructor ItemLight  [line 88]

  ItemLight ItemLight( [object table $db_row = NULL], [string $dbtable = 'T_items__item'], [string $dbprefix = 'post_'], [string $dbIDname = 'post_ID'], [string $objtype = 'ItemLight'], [string $datecreated_field = ''], [string $datemodified_field = 'datemodified'], [string $creator_field = ''], [string $lasteditor_field = '']  )

Constructor

Parameters:
object table   $db_row:  Database row
string   $dbtable: 
string   $dbprefix: 
string   $dbIDname: 
string   $objtype:  for derived classes
string   $datecreated_field:  datetime field name
string   $datemodified_field:  datetime field name
string   $creator_field:  User ID field name
string   $lasteditor_field:  User ID field name


[ Top ]
categories  [line 198]

  void categories( [array $params = array()]  )

T-Tag: list all the category names

  1.  $params array_mergearray(
  2.    'before'           => '',
  3.    'after'            => ' ',
  4.    'include_main'     => true,
  5.    'before_main'      => '',
  6.    'after_main'       => '',
  7.    'include_other'    => true,
  8.    'before_other'     => '',
  9.    'after_other'      => '',
  10.    'include_external' => true,
  11.    'before_external'  => '<em>',
  12.    'after_external'   => '</em>',
  13.    'separator'        => ', ',
  14.    'link_categories'  => true,
  15.    'link_title'       => T_('Browse category'),
  16.    'format'           => 'htmlbody',
  17.  )$params );

Parameters:
array   $params: 


[ Top ]
get_archive_url  [line 272]

  void get_archive_url( [string $blogurl = ''], [string $glue = '&amp;']  )

Generate a link to the post in the archives

Parameters:
string   $blogurl:  base url to use
string   $glue:  glue between url params


[ Top ]
get_Blog  [line 143]

  Blog &get_Blog( )

Get the Blog object for the Item.



[ Top ]
get_blog_ID  [line 291]

  integer get_blog_ID( )

Get the blog ID of this item (derived from main chapter).



[ Top ]
get_Chapters  [line 372]

  array get_Chapters( )

Get list of Chapter objects.


API Tags:
Return:  of chapters (references)


[ Top ]
get_Chapter_IDs  [line 312]

  array get_Chapter_IDs( )

Get the chapter (category) IDs for this item.

Loads the extra categories and populates ItemLight::extra_cat_IDs if necessary. This method automatically populates the ItemCatsCache for other posts in the item list.


API Tags:
Return:  The category IDs.


[ Top ]
get_chapter_url  [line 352]

  void get_chapter_url( [string $blogurl = ''], [string $glue = '&amp;']  )

Generate a link to the post in the category

Parameters:
string   $blogurl:  base url to use
string   $glue:  glue between url params


[ Top ]
get_excerpt  [line 394]

  string get_excerpt( [string $format = 'htmlbody']  )

Template function: get excerpt

Parameters:
string   $format:  filename to use to display more

Information Tags:
Todo:  do we want excerpts in itemLight or not?

[ Top ]
get_issue_date  [line 413]

  void get_issue_date( [ $params = array()]  )

T-Tag: returns formatted issue date or time (datetime) of Item

  1.  $params array_mergearray(
  2.    'before'      => '',
  3.    'after'       => ' ',
  4.    'date_format' => '#'// '#' = locale_datefmt()
  5.    'use_GMT'     => false,
  6.  )$params );

Parameters:
   $params: 

API Tags:
Usedby:  ItemLight::issue_time()
Usedby:  ItemLight::issue_date()


[ Top ]
get_main_Chapter  [line 159]

  Chapter &get_main_Chapter( )

Get the main Chapter.



[ Top ]
get_permanent_link  [line 441]

  void get_permanent_link( [string $text = '#'], [string $title = '#'], [string $class = '']  )

T-Tag: Get the linked permanent url (permalink) for the item

Note: If you only want the permalink URL, use Item::get_permanent_url()

Parameters:
string   $text:  link text or special value: '#', '#icon#', '#text#', '#title#' '... $title$ ...'
string   $title:  link title
string   $class:  class name

API Tags:
Usedby:  ItemLight::permanent_link()


[ Top ]
get_permanent_url  [line 490]

  void get_permanent_url( [string $permalink_type = ''], [string $blogurl = ''], [string $glue = '&amp;']  )

Generate the permalink for the item.

Note: Each item has an unique permalink at any given time. Some admin settings may however change the permalinks for previous items. Note: This actually only returns the URL, to get a real link, use Item::get_permanent_link()

Parameters:
string   $permalink_type:  single, archive, subchap
string   $blogurl:  base url to use
string   $glue:  glue between url params

Information Tags:
Todo:  archives modes in clean URL mode

[ Top ]
get_prefetch_itemlist_IDs  [line 525]

  array get_prefetch_itemlist_IDs( )

Get a list of item IDs from $MainList and $ItemList, if they are loaded.

This is used for prefetching item related data for the whole list(s). This will at least return the item's ID itself.



[ Top ]
get_single_url  [line 552]

  void get_single_url( [boolean $allow_redir = true], [string $blogurl = ''], [string $glue = '&amp;']  )

Generate a single post link for the item

Parameters:
boolean   $allow_redir:  allow redir to permalink, true | false | 'auto' to prevent redit only if single isn't the current permalink type
string   $blogurl:  base url to use
string   $glue:  glue between url params


[ Top ]
get_title  [line 629]

  string get_title( [ $params = array()]  )

Get "nice" title of the Item

Parameters:
   $params: 

API Tags:
Usedby:  ItemLight::title()


[ Top ]
issue_date  [line 728]

  void issue_date( [ $params = array()]  )

T-Tag: Display issue date/time of an item

Parameters:
   $params: 

API Tags:
Uses:  ItemLight::get_issue_date()


[ Top ]
issue_time  [line 739]

  void issue_time( [ $params = array()]  )

T-Tag: Display issue date/time of an item

Parameters:
   $params: 

API Tags:
Uses:  ItemLight::get_issue_date()


[ Top ]
is_featured  [line 717]

  boolean is_featured( )

T-Tag: Is this a 'featured' post?

Any intro post will return false even if it's checked as "featured"



[ Top ]
is_intro  [line 704]

  boolean is_intro( )

T-Tag: Is this an 'intro' post?



[ Top ]
lang  [line 763]

  void lang( )

Template function: display locale for item



[ Top ]
language  [line 774]

  void language( [string $format = 'htmlbody']  )

Template function: display language name for item

Parameters:
string   $format:  Output format, see format_to_output()


[ Top ]
load_Blog  [line 787]

  void load_Blog( )

Load the Blog object for the Item, without returning it.

This is needed for Results object callbacks.



[ Top ]
locale  [line 800]

  void locale( )

Template function: display locale for item



[ Top ]
locale_flag  [line 823]

  void locale_flag( [array $params = array()]  )

T-Tag: Displays or returns an author's locale flag

  1.  $params array_mergearray(
  2.    'before'     => ' ',
  3.    'after'      => ' ',
  4.    'collection' => 'h10px'// 'h10px' or 'w16px'
  5.    'format'     => 'htmlbody',
  6.    'class'      => 'flag',
  7.    'align'      => '',
  8.  )$params );

Parameters:
array   $params: 

API Tags:
Usedby:  ItemLight::locale_flag()
Uses:  ItemLight::locale_flag()


[ Top ]
locale_temp_switch  [line 846]

  void locale_temp_switch( )

T-Tag: Temporarily switch to this item's locale


API Tags:
Usedby:  ItemLight::locale_temp_switch()
Uses:  ItemLight::locale_temp_switch()


[ Top ]
main_category  [line 857]

  void main_category( [string $format = 'htmlbody']  )

Template function: display main category name

Parameters:
string   $format:  Output format, see format_to_output()


[ Top ]
mod_date  [line 870]

  void mod_date( [string $format = ''], [boolean $useGM = false]  )

Template function: display last mod date (datetime) of Item

Parameters:
string   $format:  date/time format: leave empty to use locale default date format
boolean   $useGM:  true if you want GMT


[ Top ]
mod_time  [line 885]

  void mod_time( [string $format = ''], [boolean $useGM = false]  )

Template function: display last mod time (datetime) of Item

Parameters:
string   $format:  date/time format: leave empty to use locale default time format
boolean   $useGM:  true if you want GMT


[ Top ]
permanent_link  [line 912]

  void permanent_link( [array $params = array()]  )

T-Tag: Display the linked permanent url (permalink) for the item

Note: If you only want the permalink URL, use Item::permanent_url()

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => '',
  4.    'text'   => '#'// possible special values: '#', '#icon#', '#text#', '#title#'
  5.    'title'  => '#'// '#' = T_('Permanent link to full entry'),
  6.    'class'  => '',
  7.  )$params );

Parameters:
array   $params: 

API Tags:
Uses:  ItemLight::get_permanent_link()


[ Top ]
permanent_url  [line 943]

  void permanent_url( [string $mode = ''], [string $blogurl = '']  )

Template function: display permalink for item

Note: This actually only outputs the URL, to display a real link, use Item::permanent_link()

Parameters:
string   $mode:  'post', 'archive#id' or 'archive#title'
string   $blogurl:  url to use


[ Top ]
set  [line 961]

  boolean set( string $parname, mixed $parvalue, [boolean $make_null = false]  )

Set param value

By default, all values will be considered strings

Parameters:
string   $parname:  parameter name
mixed   $parvalue:  parameter value
boolean   $make_null:  true to set to NULL if empty value

API Tags:
Return:  true, if a value has been set; false if it has not changed

Information Tags:
Todo:  extra_cat_IDs recording

Redefinition of:
DataObject::set()
Set param value

Redefined in descendants as:

[ Top ]
set_extracats  [line 1015]

  boolean set_extracats( array $cats, [boolean $add = false]  )

Set the extra categories for this item.

NOTE: Use ItemLight::set( 'extra_cat_IDs', ... ) to set the extra categories.

Parameters:
array   $cats:  An array containing the extra category IDs.
boolean   $add:  Whether to add the new categories to the existing ones.

API Tags:
Return:  True if the extra categories have changed.

Information Tags:
Todo:  Tblue> Check whether a change should invalidate the ItemCatsCache for this Item.

[ Top ]
title  [line 1072]

  void title( [ $params = array()]  )

T-Tag: Display title for item and link to related URL

Parameters:
   $params: 

API Tags:
Uses:  ItemLight::get_title()


[ Top ]
type  [line 1085]

  void type( [string $before = ''], [string $after = ''], [string $format = 'htmlbody']  )

Template function: display type of item

Parameters:
string   $before: 
string   $after: 
string   $format:  Output format, see format_to_output()


[ Top ]