\Pastie_Driver_Rdo

Pastie storage implementation for Horde's Rdo ORM Layer.

Required values for $params:

'db'       The Horde_Db adapter

Copyright 2012-2017 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.

Summary

Methods
Properties
Constants
__construct()
savePaste()
getPaste()
getPastes()
No public properties found
No constants found
_fromBackend()
$_db
$_mappers
N/A
No private methods found
No private properties found
N/A

Properties

$_db

$_db : \DB

Handle for the database connection.

Type

\DB

$_mappers

$_mappers : \Horde_Rdo_Factory

The mapper factory

Type

\Horde_Rdo_Factory

Methods

__construct()

__construct(array  $params = array()) 

This is the basic constructor for the Rdo driver.

Parameters

array $params

Hash containing the connection parameters.

savePaste()

savePaste(string  $bin, string  $content, string  $syntax = 'none', string  $title = '') : string

Create a new paste in backend.

Parameters

string $bin

the paste bin to fill

string $content

the actual paste content

string $syntax

the highlighting syntax keyword

string $title

the title line of the paste

Returns

string —

uuid of the new paste

getPaste()

getPaste(array  $params) : array

Retrieves the paste from the database.

Parameters

array $params

Array of selectors to find the paste.

Returns

array —

Array of paste information

getPastes()

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

Parameters

string $bin

A paste bin to query

integer $limit

a maximum of pastes to retrieve (optional, default to null = all)

$start

Returns

array —

a list of pastes

_fromBackend()

_fromBackend(array|\Pastie_Entity_Paste  $paste) : \an

Convert a backend hash or object to an application context hash.

This is ugly and may be redesigned or refactored

Parameters

array|\Pastie_Entity_Paste $paste

A paste hash or Rdo object.

Returns

\an —

application context hash