PHP Class Pastie_Driver_Rdo, horde

Required values for $params:
     'db'       The Horde_Db adapter

Copyright 2012-2016 Horde LLC (http://www.horde.org/)
Based on the original Sql driver by Ben Klang

See the enclosed file LICENSE for license information (BSD). If you
did not receive this file, see http://www.horde.org/licenses/bsd.
Author: Ralf Lang ([email protected])
Inheritance: extends Pastie_Driver
Afficher le fichier Open project: horde/horde

Protected Properties

Свойство Type Description
$_db DB Handle for the database connection.
$_mappers Horde_Rdo_Factory The mapper factory

Méthodes publiques

Méthode Description
__construct ( array $params = [] ) This is the basic constructor for the Rdo driver.
getPaste ( array $params ) : array Retrieves the paste from the database.
getPastes ( string $bin, integer $limit = null, $start = null ) : array get any number of pastes from a bin, ordered by date, narrowed by limit and offset
savePaste ( string $bin, string $content, string $syntax = 'none', string $title = '' ) : string Create a new paste in backend.

Méthodes protégées

Méthode Description
_fromBackend ( array | Pastie_Entity_Paste $paste ) : an Convert a backend hash or object to an application context hash.

Method Details

__construct() public méthode

This is the basic constructor for the Rdo driver.
public __construct ( array $params = [] )
$params array Hash containing the connection parameters.

_fromBackend() protected méthode

This is ugly and may be redesigned or refactored
protected _fromBackend ( array | Pastie_Entity_Paste $paste ) : an
$paste array | Pastie_Entity_Paste A paste hash or Rdo object.
Résultat an application context hash

getPaste() public méthode

Retrieves the paste from the database.
public getPaste ( array $params ) : array
$params array Array of selectors to find the paste.
Résultat array Array of paste information

getPastes() public méthode

get any number of pastes from a bin, ordered by date, narrowed by limit and offset
public getPastes ( string $bin, integer $limit = null, $start = null ) : array
$bin string A paste bin to query
$limit integer a maximum of pastes to retrieve (optional, default to null = all)
Résultat array a list of pastes

savePaste() public méthode

Create a new paste in backend.
public savePaste ( string $bin, string $content, string $syntax = 'none', string $title = '' ) : string
$bin string the paste bin to fill
$content string the actual paste content
$syntax string the highlighting syntax keyword
$title string the title line of the paste
Résultat string uuid of the new paste

Property Details

$_db protected_oe property

Handle for the database connection.
protected DB $_db
Résultat DB

$_mappers protected_oe property

The mapper factory
protected Horde_Rdo_Factory $_mappers
Résultat Horde_Rdo_Factory