db
DBConnectionCommon Class Reference

Inherits DBConnection.

Inherited by DBConnectionMySQLImpl, and DBConnectionPostgreSQLImpl.

Public Member Functions

 __construct (PDO $pdo, $dbType, $settings)
 
 getDefaultSettings ()
 
 getPDO ()
 
 getDbType ()
 
 getNamingStrategy ()
 
 setNamingStrategy (NamingStrategy $namingStrategy)
 
 load ($className, $id)
 
 loadAll ($className)
 
 find ($className, array $params, array $orders=[])
 
 update ($obj)
 
 save ($obj)
 
 delete ($obj, $className=NULL)
 
 close ()
 
 beginTransaction ()
 
 commit ()
 
 rollBack ()
 
 executeFind ($className, $qureyFactory, $methodName, $parameters)
 
 executeCount ($className, $qureyFactory, $methodName, $parameters)
 
 executeCustomFind ($className, $qureyFactory, $methodName, array $parameters, array $queryTypeParameters)
 
 executeCustomCount ($className, $qureyFactory, $methodName, array $parameters, array $queryTypeParameters)
 
 executeDelete ($className, $qureyFactory, $methodName, $parameters)
 
 executeUpdate ($className, $queryFactory, $methodName, $parameters)
 
 paginate ($className, PaginatorFactory $paginatorFactory, PaginatorConfig $config)
 
 fetchObject ($className, $statement)
 
 fetchObjectArray ($className, $statement)
 
 getClassDesctiption ($className)
 
 getPropertyDescriptions (ClassDescription $classDescription, $propertyDefinitions, $propertyTypes)
 
 __toString ()
 
 getDaoImplCacheDir ()
 vygenerovane gettery a settery More...
 
 setDaoImplCacheDir ($daoImplCacheDir)
 
- Public Member Functions inherited from DBConnection
 delete ($obj)
 

Protected Member Functions

 createInsertSQLString (ClassDescription $classDescription)
 
 getLastInsertedId (PDO $pdo, PDOStatement $statement)
 
 bindSerializedValue ($classDescription, $statement, $obj, $propertyName)
 
 getSqlStatemetCache ($className)
 
 isInFileStorage (File $file)
 

Protected Attributes

 $pdo
 
 $dbType
 
 $namingStrategy
 
 $classDescriptions = []
 
 $sqlStatementsCache = []
 
 $objectCache = []
 
 $accessabeFileDir = NULL
 
 $hiddenFilesDir = NULL
 
 $daoImplCacheDir = NULL
 
 $missingFileFilePath = NULL
 
 $settings = NULL
 

Detailed Description

Obsahuje slopecnou logiku sdilenou mezi vsemi dbPripojenumi

Constructor & Destructor Documentation

◆ __construct()

__construct ( PDO  $pdo,
  $dbType,
  $settings 
)

Member Function Documentation

◆ __toString()

__toString ( )

◆ beginTransaction()

beginTransaction ( )

zapocne transakci

Implements DBConnection.

◆ bindSerializedValue()

bindSerializedValue (   $classDescription,
  $statement,
  $obj,
  $propertyName 
)
protected

do statementu nastavi hodnotu parametru

Parameters
type$classDescription
type$statement
type$obj
type$propertyName

◆ close()

close ( )

closes connection an frees all cashed data

Implements DBConnection.

◆ commit()

commit ( )

commituje transakci

Implements DBConnection.

◆ createInsertSQLString()

createInsertSQLString ( ClassDescription  $classDescription)
abstractprotected

vytvori string pro insert do tabulty pro tridu definovanou pomoci $classDescription

Parameters
ClassDescription$classDescriptiontrida pro kterou se ma vytvorit sql
Returns
string

◆ delete()

delete (   $obj,
  $className = NULL 
)
See also
::delete()

◆ executeCount()

executeCount (   $className,
  $qureyFactory,
  $methodName,
  $parameters 
)

provede count

Parameters
class$className
string$methodName
array$parameters

◆ executeCustomCount()

executeCustomCount (   $className,
  $qureyFactory,
  $methodName,
array  $parameters,
array  $queryTypeParameters 
)

vyt

Parameters
string$classNamejmeno tridy nad kterou se provadi dotaz
type$qureyFactory
type$methodName
array$parameters
array$queryTypeParameterspuvodne bylo na slozeni order by, ale spis budou obecne jakekoli parametry potrebne pro slozeni dotazu
Returns
type
Exceptions
Exception

◆ executeCustomFind()

executeCustomFind (   $className,
  $qureyFactory,
  $methodName,
array  $parameters,
array  $queryTypeParameters 
)

provede find dotaz

Parameters
class$className
string$methodName
array$parameters

◆ executeDelete()

executeDelete (   $className,
  $qureyFactory,
  $methodName,
  $parameters 
)

provede delete dotaz

Parameters
type$className
type$methodName
type$parameters

◆ executeFind()

executeFind (   $className,
  $qureyFactory,
  $methodName,
  $parameters 
)
Parameters
string | class$className
QueryFactory | array$qureyFactory
string$methodName
array$parameters
Returns
QueryResult

◆ executeUpdate()

executeUpdate (   $className,
  $queryFactory,
  $methodName,
  $parameters 
)

provede update dotaz

Parameters
type$className
type$methodName
type$parameters

◆ fetchObject()

fetchObject (   $className,
  $statement 
)

fetches one object from PDO statement result

Parameters
class$className
PDOStatement$statement

◆ fetchObjectArray()

fetchObjectArray (   $className,
  $statement 
)

vrati pole objektu

Parameters
type$className
type$statement
Returns
type

◆ find()

find (   $className,
array  $params,
array  $orders = [] 
)
Parameters
class$className
array$paramsParametry
Returns
QueryResult returns all object of class $className in undetermined order

Implements DBConnection.

◆ getClassDesctiption()

getClassDesctiption (   $className)

vrati popis tridy, ulozi ho pokud neexistuje

Parameters
class$className
Returns
ClassDescription Description

◆ getDaoImplCacheDir()

getDaoImplCacheDir ( )

vygenerovane gettery a settery

◆ getDbType()

getDbType ( )

vraci jaka db je pripojena

Returns
string

Implements DBConnection.

◆ getDefaultSettings()

getDefaultSettings ( )

TODO: melo by se presunout do konstruktoru

Returns
type Description defaultni nastaveni pro vsechny db

◆ getLastInsertedId()

getLastInsertedId ( PDO  $pdo,
PDOStatement  $statement 
)
abstractprotected

vraci vygenerovane id posledniho vlozene zaznamu

Parameters
PDO$pdopdo db pripojeni
PDOStatement$statementstatement ktery byl vykonan
Returns
id

◆ getNamingStrategy()

getNamingStrategy ( )

strategie pro prevod nazvu objektu na tabulky

Returns
NamingStrategy

Implements DBConnection.

◆ getPDO()

getPDO ( )

TODO docasne, melo by se odstranit a odstinit zbytek aplikace od PDO

Returns
PDO

◆ getPropertyDescriptions()

getPropertyDescriptions ( ClassDescription  $classDescription,
  $propertyDefinitions,
  $propertyTypes 
)
abstract

◆ getSqlStatemetCache()

getSqlStatemetCache (   $className)
protected
Parameters
class$className
Returns
SqlStatementCache Description

◆ isInFileStorage()

isInFileStorage ( File  $file)
protected

vraci ture pokud je soubor v db storage

Parameters
File$file
Returns
type

◆ load()

load (   $className,
  $id 
)
See also
::load()

Implements DBConnection.

◆ loadAll()

loadAll (   $className)
See also
::loadAll()

Implements DBConnection.

◆ paginate()

paginate (   $className,
PaginatorFactory  $paginatorFactory,
PaginatorConfig  $config 
)

◆ rollBack()

rollBack ( )

rollbackuje transakci

Implements DBConnection.

◆ save()

save (   $obj)
See also
DBConnection::save()

Implements DBConnection.

◆ setDaoImplCacheDir()

setDaoImplCacheDir (   $daoImplCacheDir)

◆ setNamingStrategy()

setNamingStrategy ( NamingStrategy  $namingStrategy)
Parameters
NamingStrategy$namingStrategy

Implements DBConnection.

◆ update()

update (   $obj)
See also
::update()

Implements DBConnection.

Member Data Documentation

◆ $accessabeFileDir

$accessabeFileDir = NULL
protected

◆ $classDescriptions

$classDescriptions = []
protected

◆ $daoImplCacheDir

$daoImplCacheDir = NULL
protected

◆ $dbType

$dbType
protected

◆ $hiddenFilesDir

$hiddenFilesDir = NULL
protected

◆ $missingFileFilePath

$missingFileFilePath = NULL
protected

◆ $namingStrategy

$namingStrategy
protected

◆ $objectCache

$objectCache = []
protected

◆ $pdo

$pdo
protected

◆ $settings

$settings = NULL
protected

◆ $sqlStatementsCache

$sqlStatementsCache = []
protected

The documentation for this class was generated from the following file: