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

Class: db

Source Location: /modules/module_db.php

Class db

Property Summary
mixed   $db_type  

[ Top ]
Method Summary
db   db()   Initialises the db.
void   allow_write()   Switches to writing-allowed mode.
void   checkTimedPublish()   Checks if any entries set to 'timed publish' should be published.
void   clearIndex()   Clears the index for searching or tags.
void   delete_comment()   Deletes a comment from the current entry.
void   delete_entries()   Delete one or more entries.
void   delete_entry()   Deletes the current entry
void   delete_trackback()   Deletes a trackback from the current entry.
void   depublish_entries()   Set one or more entries to 'hold'
void   disallow_write()   Switches to writing-disallowed mode.
boolean   entry_exists()   Tells if the entry exists.
void   generate_index()   Rebuilds the index, if necessary.
array   getArchiveArray()   Gets an array of archives.
array   getEntryInAllLanguages()   As ready entry but retrieves all the languages at once
array   getlist()   Gets a list of entries by date. This function is really deprecated and acts like a wrapper around read_entries.
void   get_comment()   Returns a comment from the current entry.
string   get_date()   Gets the date for an entry
int   get_entries_count()   Gets the number of entries.
array   get_entry_by_uri()   Get an entry by its specific URI.
int   get_next_code()   Gets the code of the next entry.
int   get_previous_code()   Gets the code of the previous entry.
void   get_trackback()   Returns a trackback from the current entry.
array   guess_entry()   Tries to guess an entry by it's (incomplete) URI and date (if available). The entry is returned as an associative array.
void   publish_entries()   Set one or more entries to 'publish'
void   read_admin_entries()  
void   read_entries()  
array   read_entry()   Retrieves a full entry as an associative array, and returns it. The $code parameter can be a code/uid or an URI. The optional $date parameter helps to narrow it down, if there's more than one option.
array   read_lasttrackbacks()   Read the last trackbacks
array   read_latestcomments()   Read the latest comments
void   saveEntryInAllLanguages()   Save an entry in all languages
boolean   save_entry()   Saves the current entry.
array   set_entry()   Sets the current entry to the contents of $entry.
array   __read_entries()   Read a bunch of entries.

[ Top ]
Properties
mixed   $db_type [line 33]

[ Top ]
Methods
Constructor db  [line 40]

  db db( [boolean $loadindex = TRUE]  )

Initialises the db.

Parameters:
boolean   $loadindex:  Whether the index should be loaded.


[ Top ]
allow_write  [line 580]

  void allow_write( )

Switches to writing-allowed mode.



[ Top ]
checkTimedPublish  [line 616]

  void checkTimedPublish( )

Checks if any entries set to 'timed publish' should be published.



[ Top ]
clearIndex  [line 626]

  void clearIndex( string $type  )

Clears the index for searching or tags.

Parameters:
string   $type: 


[ Top ]
delete_comment  [line 484]

  void delete_comment( integer $uid  )

Deletes a comment from the current entry.

Parameters:
integer   $uid:  uid


[ Top ]
delete_entries  [line 469]

  void delete_entries( array $ids  )

Delete one or more entries.

Parameters:
array   $ids: 


[ Top ]
delete_entry  [line 455]

  void delete_entry( )

Deletes the current entry



[ Top ]
delete_trackback  [line 512]

  void delete_trackback( integer $uid  )

Deletes a trackback from the current entry.

Parameters:
integer   $uid:  uid


[ Top ]
depublish_entries  [line 604]

  void depublish_entries( array $ids  )

Set one or more entries to 'hold'

Parameters:
array   $ids: 


[ Top ]
disallow_write  [line 572]

  void disallow_write( )

Switches to writing-disallowed mode.



[ Top ]
entry_exists  [line 178]

  boolean entry_exists( int $code  )

Tells if the entry exists.

Parameters:
int   $code:  The code/id of the entry.


[ Top ]
generate_index  [line 158]

  void generate_index( )

Rebuilds the index, if necessary.



[ Top ]
getArchiveArray  [line 100]

  array getArchiveArray( [boolean $force = FALSE], string $unit  )

Gets an array of archives.

Parameters:
boolean   $force:  tells if the cache (if any) should be updated.
string   $unit:  the unit of the archives.


[ Top ]
getEntryInAllLanguages  [line 213]

  array getEntryInAllLanguages( integer $uid  )

As ready entry but retrieves all the languages at once

Parameters:
integer   $uid: 

API Tags:
Return:  entry with all languages


[ Top ]
getlist  [line 77]

  array getlist( int $amount, [int $offset = 0], [mixed $filteronuser = ""], [mixed $filteroncat = ""], [boolean $order = TRUE], [string $field = ""], [string $status = ""]  )

Gets a list of entries by date. This function is really deprecated and acts like a wrapper around read_entries.

Parameters:
int   $amount: 
int   $offset: 
mixed   $filteronuser: 
mixed   $filteroncat: 
boolean   $order:  Defines whether the results are in chronological order (false means reverse order).
string   $field:  The field to order by.
string   $status:  Return only entries with this status.


[ Top ]
get_comment  [line 499]

  void get_comment( integer $uid  )

Returns a comment from the current entry.

Parameters:
integer   $uid:  uid


[ Top ]
get_date  [line 563]

  string get_date( int $code  )

Gets the date for an entry

Parameters:
int   $code: 


[ Top ]
get_entries_count  [line 125]

  int get_entries_count( [array $params = false]  )

Gets the number of entries.

The $params array can take the same keys as in the read_entries function, but only the following keys give meaning when counting:

  • 'offset': The offset from the beginning of the filtered and sorted/ordered array.
  • 'cats': Filter entries by category/ies.
  • 'extrafields': Filter entries by extrafields.
  • 'user': Filter entries by user(s).
  • 'status': Filter entries by status.
  • 'date': A date range - day, month or year.
  • 'start'/'end': A start/end date.
'cats', 'extrafields' and 'user' can either be (comma separated) strings or arrays.

Parameters:
array   $params: 


[ Top ]
get_entry_by_uri  [line 388]

  array get_entry_by_uri( string $uri, [ $language = false], string $date  )

Get an entry by its specific URI.

Parameters:
string   $uri: 
string   $date: 
   $language: 


[ Top ]
get_next_code  [line 138]

  int get_next_code( [int $num = 1], [ $category = ""]  )

Gets the code of the next entry.

Parameters:
int   $num: 
   $category: 


[ Top ]
get_previous_code  [line 149]

  int get_previous_code( [int $num = 1], [ $category = ""]  )

Gets the code of the previous entry.

Parameters:
int   $num: 
   $category: 


[ Top ]
get_trackback  [line 526]

  void get_trackback( integer $uid  )

Returns a trackback from the current entry.

Parameters:
integer   $uid:  uid


[ Top ]
guess_entry  [line 371]

  array guess_entry( string $uri, [string $date = '']  )

Tries to guess an entry by it's (incomplete) URI and date (if available). The entry is returned as an associative array.

Parameters:
string   $uri: 
string   $date: 


[ Top ]
publish_entries  [line 590]

  void publish_entries( array $ids  )

Set one or more entries to 'publish'

Parameters:
array   $ids: 


[ Top ]
read_admin_entries  [line 358]

  void read_admin_entries( $params  )

Parameters:
   $params: 


[ Top ]
read_entries  [line 354]

  void read_entries( $params  )

Parameters:
   $params: 


[ Top ]
read_entry  [line 192]

  array read_entry( mixed $code, [string $date = ""], [ $language = false]  )

Retrieves a full entry as an associative array, and returns it. The $code parameter can be a code/uid or an URI. The optional $date parameter helps to narrow it down, if there's more than one option.

Parameters:
mixed   $code: 
string   $date: 
   $language: 


[ Top ]
read_lasttrackbacks  [line 415]

  array read_lasttrackbacks( array $params  )

Read the last trackbacks

Parameters:
array   $params: 


[ Top ]
read_latestcomments  [line 402]

  array read_latestcomments( array $params  )

Read the latest comments

Parameters:
array   $params: 


[ Top ]
saveEntryInAllLanguages  [line 230]

  void saveEntryInAllLanguages( [boolean $update_index = TRUE]  )

Save an entry in all languages

Parameters:
boolean   $update_index: 


[ Top ]
save_entry  [line 542]

  boolean save_entry( [boolean $update_index = TRUE]  )

Saves the current entry.

Returns true if successfully saved. Current implementation (in module_db_xml.php) seems to return true no matter what.

Parameters:
boolean   $update_index:  Whether to update the date index.


[ Top ]
set_entry  [line 431]

  array set_entry( array $entry  )

Sets the current entry to the contents of $entry.

Returns the inserted entry as it got stored in the database with correct code/id and Word HTML stripped off.

Parameters:
array   $entry:  The entry to be inserted


[ Top ]
__read_entries  [line 272]

  array __read_entries( array $params, [boolean $admin = false]  )

Read a bunch of entries.

The $params array can have the following keys:

  • 'full': Determines if the returned entries should be full (contain all fields), the default, or be reduced. (true/false)
  • 'show': Amount of entries to read.
  • 'offset': The offset from the beginning of the filtered and sorted/ordered array.
  • 'cats': Filter entries by category/ies.
  • 'extrafields': Filter entries by extrafields.
  • 'user': Filter entries by user(s).
  • 'status': Filter entries by status.
  • 'order': Select random, asc(ending) or des(cending).
  • 'orderby': Default is date, but any entry field (e.g. code/uid) can be used.
  • 'date': A date range - day, month or year.
  • 'start'/'end': A start/end date.
'cats', 'extrafields' and 'user' can either be (comma separated) strings or arrays.

Parameters:
array   $params: 
boolean   $admin:  (true if admin is loading entries)


[ Top ]

Documentation generated on Tue, 22 May 2012 01:07:21 +0200 by phpDocumentor 1.4.3