---
name: "LedgerSMB::DBObject"
section: "3pm"
platform: "linux"
package: "ledgersmb"
version: "1.3.40-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/LedgerSMB::DBObject"
---

# LedgerSMB::DBObject(3pm)

LedgerSMB class for building objects from db relations

## NAME

LedgerSMB::DBObject - LedgerSMB class for building objects from db relations

## SYOPSIS

This module creates object instances based on LedgerSMB's in-database ORM.

## METHODS

- new ($class, base =\> $LedgerSMB::hash)

  This is the base constructor for all child classes.  It must be used with base argument because this is necessary for database connectivity and the like.

  Of course the base object can be any object that inherits LedgerSMB, so you can use any subclass of that.  The per-session dbh is passed between the objects  this way as is any information that is needed.

- exec\_method

  ($self, procname =\> `$function_name`, \[args =\> \\@args, schema =\> `$schema`, continue\_on\_error=\>$continue\_on\_error\])

  Provides the basic mapping of parameters to the SQL stored procedure function  arguments.

  If \\@args is not defined, args are mapped from the object's properties,  stripping them of their in\_ prefix.  If schema is provided, that is used  instead of PostgreSQL's search path.  If continue\_on\_error is provided and true, the operation will not raise an exception in the event of a database error, and  it will be up to the application to handle any exceptions.

- \_\_validate\_\_ is called on every *new()* invocation. It is blank in this module but can be overridden in decendant modules.

  - \_db\_array\_scalars(@elements) creates a db array from scalars.

  - \_db\_array\_literal(@elements) creates a multiple dimension db array from preparsed db arrays or other data which does not need to be escaped.

  - set\_ordering

  Sets the ordering used by default for specific functions called by exec\_method

- run\_custom\_queries

  Backward-compatible with 1.2 custom query system for moving forward.

## Copyright (C) 2007, The LedgerSMB core team.

This file is licensed under the Gnu General Public License version 2, or at your option any later version.  A copy of the license should have been included with your software.
