Пример #1
0
 /**
  * Obtem um objeto da classe especificada carregada com os parâmetros fornecidos
  * em $whereCondition
  * @param string $className nome da classe
  * @param string|int $whereCondition condição de carregamento
  * @param boolean $loadArrayAtributes se os atributos do tipo array devem ser carregados
  * @return object
  */
 public static function load($classOrObject, $whereCondition, $loadArrayAtributes = false)
 {
     if (strlen($whereCondition) < 4) {
         $whereCondition = (int) $whereCondition;
     }
     $crud = new CRUD($classOrObject);
     $obj = self::getInstance($classOrObject);
     $crud->mountObject($whereCondition, "", $obj);
     if ($loadArrayAtributes) {
         $crud->loadArrayAttributes($obj);
     }
     return $obj;
 }