previousDB_DataObject::staticGet() (Previous) (Next) ->find()next

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

{Child Class}::staticGet()

{Child Class}::staticGet() – Requête SELECT et mise en cache

Synopsis

object {Child Class}::staticGet ( mixed $key or $value , mixed $value )

Description

La méthode statique est similaire à la requête SELECT, cependant, elle ne nécessite pas l'instanciation de la classe. staticGet() peut optionnellement mettre en cache les résultats. (voir la section configuration)

Parameter

  • string $key - colonne ou valeur si seulement 1 paramètre est fournit

  • mixed $value - valeur

Return value

object mixed - FALSE ou l'objet

Throws

Possible PEAR_Error values
Code erreur Message d'erreur Signification Solution
DB_DATAOBJECT_ERROR_NOCLASS "could not autoload $class" Impossible de charger $class  
DB_DATAOBJECT_ERROR_NOCLASS "Error creating $newclass" Erreur lors de la création de $newclass  
DB_DATAOBJECT_ERROR_NODATA "No Data return from get $key $value" Aucune donnée retournée depuis $key $value  

Note

Cette méthode doit être appelée statiquement.

Example

Récupération simple de données basée sur une clé primaire

<?php
$person 
DataObjects_Person::staticGet(12);
print_r($person);
?>
previousDB_DataObject::staticGet() (Previous) (Next) ->find()next

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.