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   __construct()   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   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'
array   read_entries()   Read a bunch of 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
boolean   save_entry()   Saves the current entry.
array   set_entry()   Sets the current entry to the contents of $entry.

[ Top ]
Properties
mixed   $db_type [line 33]

[ Top ]
Methods
Constructor __construct  [line 40]

  db __construct( [boolean $loadindex = TRUE]  )

Initialises the db.

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


[ Top ]
allow_write  [line 512]

  void allow_write( )

Switches to writing-allowed mode.



[ Top ]
checkTimedPublish  [line 548]

  void checkTimedPublish( )

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



[ Top ]
clearIndex  [line 558]

  void clearIndex( string $type  )

Clears the index for searching or tags.

Parameters:
string   $type: 


[ Top ]
delete_comment  [line 416]

  void delete_comment( integer $uid  )

Deletes a comment from the current entry.

Parameters:
integer   $uid:  uid


[ Top ]
delete_entries  [line 401]

  void delete_entries( array $ids  )

Delete one or more entries.

Parameters:
array   $ids: 


[ Top ]
delete_entry  [line 387]

  void delete_entry( )

Deletes the current entry



[ Top ]
delete_trackback  [line 444]

  void delete_trackback( integer $uid  )

Deletes a trackback from the current entry.

Parameters:
integer   $uid:  uid


[ Top ]
depublish_entries  [line 536]

  void depublish_entries( array $ids  )

Set one or more entries to 'hold'

Parameters:
array   $ids: 


[ Top ]
disallow_write  [line 504]

  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 ]
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 431]

  void get_comment( integer $uid  )

Returns a comment from the current entry.

Parameters:
integer   $uid:  uid


[ Top ]
get_date  [line 495]

  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 320]

  array get_entry_by_uri( string $uri, string $date  )

Get an entry by its specific URI.

Parameters:
string   $uri: 
string   $date: 


[ 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 458]

  void get_trackback( integer $uid  )

Returns a trackback from the current entry.

Parameters:
integer   $uid:  uid


[ Top ]
guess_entry  [line 303]

  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 522]

  void publish_entries( array $ids  )

Set one or more entries to 'publish'

Parameters:
array   $ids: 


[ Top ]
read_entries  [line 230]

  array read_entries( array $params  )

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: 


[ Top ]
read_entry  [line 192]

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

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: 


[ Top ]
read_lasttrackbacks  [line 347]

  array read_lasttrackbacks( array $params  )

Read the last trackbacks

Parameters:
array   $params: 


[ Top ]
read_latestcomments  [line 334]

  array read_latestcomments( array $params  )

Read the latest comments

Parameters:
array   $params: 


[ Top ]
save_entry  [line 474]

  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 363]

  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 ]

Documentation generated on Tue, 27 Jun 2017 01:06:16 +0200 by phpDocumentor 1.4.3