Copied!

Static acces to the ORM

CloneableInstantiable
Properties
public static string $idSuffix = 'Id'
public static string $migrationNamespace = 'App\Migration'
public static string $namespaceRoot = '/homepages/18/d179646520/htdocs/PHPFUIWebsite/PHPFUI/..'
public static string $recordNamespace = 'App\Record'
public static string $tableNamespace = 'App\Table'
Methods
public static addConnection(PHPFUI\ORM\PDOInstance $pdo, string $name = '') : string|int
 

Add a PDO instance and return the index for future reference. Use the return value to switch bethin

public static beginTransaction() : bool
 

Clears an existing errors and begins a transaction

public static commit() : bool
 

Commits the current transaction

public static describeTable(string $table) : array
 
  • return \PHPFUI\ORM\Schema\Field[]
public static execute(string $sql, array $input = []) : bool
 

Executes the SQL string using the matching $input array

  • param array $input
  • return bool status of command run
public static executeStatement(PDOStatement $statement, array $input = []) : ?PDOStatement
 

Executes the query and catches any errors

  • param array $input
public static getArrayCursor(string $sql = 'select 0 limit 0', array $input = []) : PHPFUI\ORM\ArrayCursor
 
  • param array $input
  • return \PHPFUI\ORM\ArrayCursor tracking the sql and input passed
public static getBaseClassName(string $table) : string
 

Get the correct class name from the table name

public static getConnection() : string|int|?null
 

Gets the current connection id in use

public static getDataObjectCursor(string $sql = 'select 0 limit 0', array $input = []) : PHPFUI\ORM\DataObjectCursor
 
  • param array $input
  • return \PHPFUI\ORM\DataObjectCursor tracking the sql and input passed
public static getIndexes(string $table) : array
 
  • return \PHPFUI\ORM\Schema\Index[]
public static getInstance() : PHPFUI\ORM\PDOInstance
public static getLastError() : string
 
  • return string error string from the most recent operation
public static getLastErrorCode() : int
 
  • return int error code from the most recent operation
public static getLastErrors() : array
 
  • return array<string,string>[] of all errors since the last transaction or last time cleared
public static getLastParameters() : array
 
  • return array of parameters from the last operation
public static getLastSql() : string
 
  • return string SQL statement with the ? inserted
public static getMigrationNamespacePath() : string
public static getRecordCursor(PHPFUI\ORM\Record $crud, string $sql = 'select 0 limit 0', array $input = []) : PHPFUI\ORM\RecordCursor
 
  • param array $input
  • return \PHPFUI\ORM\RecordCursor tracking the sql and input passed
public static getRecordNamespacePath() : string
public static getRow(string $sql, array $input = []) : array
 
  • param array $input
  • return array<string,string> a single row of the first matching record or an empty array if an error
public static getRows(string $sql, array $input = [], int $fetchType = 2PDO::FETCH_ASSOC) : array
 

Similar to getArrayCursor except returns a fully populated array

It is recommended to use getArrayCursor if you don't need array functionality

  • param array $input
  • return array<string,string>[]
public static getTableNamespacePath() : string
public static getTables() : array
 
  • return string[]
public static getValue(string $sql, array $input = []) : string
 
  • param array $input
  • return string value returned from the first field in the first row returned by the querry, or blank if error
public static getValueArray(string $sql, array $input = []) : array
 
  • param array $input
  • return array of the first value in each row from the query
public static lastInsertId(string $name = '') : string
 
  • return string primary key of the last record inserted
public static log(string $type, string $message, array $context = []) : void
 

Logs array of errors via error_log

  • param array $context
public static pdo() : ?PHPFUI\ORM\PDOInstance
 
  • return ?\PHPFUI\ORM\PDOInstance the underlying PDO object
public static reportErrors() : void
 

Logs errors and clears error log

public static rollBack() : bool
 

Rolls back the current transaction

public static setLogger(Psr\Log\AbstractLogger $logger) : void
public static setTranslationCallback( $callback) : void
 
  • param callable $callback
public static trans(string $text, array $variables = []) : string
 

Translate a field. See PHPFUI\Translation

    public static useConnection(string|int $connection) : string|int|?null
     

    Use a specific connection

    • return null if requested connection is not found, else returns the previously selected connection
    Properties
    private static string|int|?null $currentInstance = NULL
    private static array $instances = []
     
    • var \PHPFUI\ORM\PDOInstance[]
    private static ?Psr\Log\AbstractLogger $logger = NULL
    private static $translationCallback = NULL
     
    • var ?callable
    Methods
    private static filePath(string $namespace) : string
    Properties
    private static string|int|?null $currentInstance = NULL
    public static string $idSuffix = 'Id'
    private static array $instances = []
     
    • var \PHPFUI\ORM\PDOInstance[]
    private static ?Psr\Log\AbstractLogger $logger = NULL
    public static string $migrationNamespace = 'App\Migration'
    public static string $namespaceRoot = '/homepages/18/d179646520/htdocs/PHPFUIWebsite/PHPFUI/..'
    public static string $recordNamespace = 'App\Record'
    public static string $tableNamespace = 'App\Table'
    private static $translationCallback = NULL
     
    • var ?callable
    Methods
    public static addConnection(PHPFUI\ORM\PDOInstance $pdo, string $name = '') : string|int
     

    Add a PDO instance and return the index for future reference. Use the return value to switch bethin

    public static beginTransaction() : bool
     

    Clears an existing errors and begins a transaction

    public static commit() : bool
     

    Commits the current transaction

    public static describeTable(string $table) : array
     
    • return \PHPFUI\ORM\Schema\Field[]
    public static execute(string $sql, array $input = []) : bool
     

    Executes the SQL string using the matching $input array

    • param array $input
    • return bool status of command run
    public static executeStatement(PDOStatement $statement, array $input = []) : ?PDOStatement
     

    Executes the query and catches any errors

    • param array $input
    private static filePath(string $namespace) : string
    public static getArrayCursor(string $sql = 'select 0 limit 0', array $input = []) : PHPFUI\ORM\ArrayCursor
     
    • param array $input
    • return \PHPFUI\ORM\ArrayCursor tracking the sql and input passed
    public static getBaseClassName(string $table) : string
     

    Get the correct class name from the table name

    public static getConnection() : string|int|?null
     

    Gets the current connection id in use

    public static getDataObjectCursor(string $sql = 'select 0 limit 0', array $input = []) : PHPFUI\ORM\DataObjectCursor
     
    • param array $input
    • return \PHPFUI\ORM\DataObjectCursor tracking the sql and input passed
    public static getIndexes(string $table) : array
     
    • return \PHPFUI\ORM\Schema\Index[]
    public static getInstance() : PHPFUI\ORM\PDOInstance
    public static getLastError() : string
     
    • return string error string from the most recent operation
    public static getLastErrorCode() : int
     
    • return int error code from the most recent operation
    public static getLastErrors() : array
     
    • return array<string,string>[] of all errors since the last transaction or last time cleared
    public static getLastParameters() : array
     
    • return array of parameters from the last operation
    public static getLastSql() : string
     
    • return string SQL statement with the ? inserted
    public static getMigrationNamespacePath() : string
    public static getRecordCursor(PHPFUI\ORM\Record $crud, string $sql = 'select 0 limit 0', array $input = []) : PHPFUI\ORM\RecordCursor
     
    • param array $input
    • return \PHPFUI\ORM\RecordCursor tracking the sql and input passed
    public static getRecordNamespacePath() : string
    public static getRow(string $sql, array $input = []) : array
     
    • param array $input
    • return array<string,string> a single row of the first matching record or an empty array if an error
    public static getRows(string $sql, array $input = [], int $fetchType = 2PDO::FETCH_ASSOC) : array
     

    Similar to getArrayCursor except returns a fully populated array

    It is recommended to use getArrayCursor if you don't need array functionality

    • param array $input
    • return array<string,string>[]
    public static getTableNamespacePath() : string
    public static getTables() : array
     
    • return string[]
    public static getValue(string $sql, array $input = []) : string
     
    • param array $input
    • return string value returned from the first field in the first row returned by the querry, or blank if error
    public static getValueArray(string $sql, array $input = []) : array
     
    • param array $input
    • return array of the first value in each row from the query
    public static lastInsertId(string $name = '') : string
     
    • return string primary key of the last record inserted
    public static log(string $type, string $message, array $context = []) : void
     

    Logs array of errors via error_log

    • param array $context
    public static pdo() : ?PHPFUI\ORM\PDOInstance
     
    • return ?\PHPFUI\ORM\PDOInstance the underlying PDO object
    public static reportErrors() : void
     

    Logs errors and clears error log

    public static rollBack() : bool
     

    Rolls back the current transaction

    public static setLogger(Psr\Log\AbstractLogger $logger) : void
    public static setTranslationCallback( $callback) : void
     
    • param callable $callback
    public static trans(string $text, array $variables = []) : string
     

    Translate a field. See PHPFUI\Translation

      public static useConnection(string|int $connection) : string|int|?null
       

      Use a specific connection

      • return null if requested connection is not found, else returns the previously selected connection
      © 2024 Bruce Wells
      Search Namespaces \ Classes
      Configuration