packaged / dal
Data Access Layer
Installs: 68 404
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 5
Forks: 2
Open Issues: 5
Requires
- php: ^7.2||^8.0
- ext-json: *
- doctrine/inflector: ~1.0
- packaged/cassandrathrift: ^20.1.0
- packaged/config: ~1.1
- packaged/docblock: ~0.1||~1.0
- packaged/helpers: ~1.23||~2.5
- packaged/log: ~1.0
- packaged/querybuilder: ~0.21
Requires (Dev)
- phpunit/phpunit: ^9.6.8
Suggests
- ext-apcu: *
- dev-master
- 1.18.3
- 1.18.2
- 1.18.1
- 1.18.0
- 1.17.0
- 1.16.1
- 1.16.0
- 1.15.4
- 1.15.3
- 1.15.2
- 1.15.1
- 1.15.0
- 1.14.1
- 1.14.0
- 1.12.0
- 1.11.1
- 1.11.0
- 1.10.0
- 1.9.10
- 1.9.9
- 1.9.8
- 1.9.7
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.9
- 1.8.8
- 1.8.7
- 1.8.6
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.7.9
- 1.7.8
- 1.7.7
- 1.7.6
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.25.2
- 0.25.1
- 0.25.0
- 0.24.2
- 0.24.1
- 0.24.0
- 0.23.5
- 0.23.4
- 0.23.3
- 0.23.2
- 0.23.1
- 0.23.0
- 0.22.1
- 0.22.0
- 0.21.0
- 0.20.1
- 0.20.0
- 0.19.2
- 0.19.1
- 0.19.0
- 0.18.4
- 0.18.3
- 0.18.2
- 0.18.1
- 0.18.0
- 0.17.0
- 0.16.5
- 0.16.4
- 0.16.3
- 0.16.2
- 0.16.1
- 0.16.0
- 0.15.4
- 0.15.3
- 0.15.2
- 0.15.1
- 0.15.0
- 0.14.0
- 0.12.2
- 0.12.1
- 0.12.0
- 0.11.0
- 0.10.5
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.1
- 0.9.0
- 0.8.5
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.0
- dev-postgres
- dev-unit-tests
- dev-unique-list
- dev-datastax-cql
- dev-cacheobj
- dev-log_prepared_queries
- dev-postgresql
- dev-connection-sharing
- dev-retries
This package is auto-updated.
Last update: 2024-11-28 11:01:35 UTC
README
Getting Started
$connectionConfig = new \Packaged\Config\Provider\Ini\IniConfigProvider(
build_path('config', 'connections.ini')
);
$datastoreConfig = new \Packaged\Config\Provider\Ini\IniConfigProvider(
build_path('config', 'datastores.ini')
);
$resolver = new \Packaged\Dal\DalResolver($connectionConfig,$datastoreConfig);
$resolver->boot();
connections.ini
[users]
construct_class = \Packaged\Dal\Ql\PdoConnection
datastores.ini
[users]
construct_class = \Packaged\Dal\Ql\QlDataStore
connection = users
users.php
class User extends QlDao
{
protected $_dataStoreName = 'users';
public $id;
public $name;
}
Basic Usage
$user = new User();
$user->name = 'Test';
$user->save();
$user->name = 'Testing';
$user->save();
$user->delete();
$user = new User();
$user->id = 4;
$user->load();
$tbUsers = User::collection(['name' => ['Test','Testing']]);
foreach($tbUsers as $user)
{
echo "Located $user->name\n";
}
$users = User::collection();
var_dump($users->min('id'));
var_dump($users->max('id'));
var_dump($users->sum('id'));
var_dump($users->avg('id'));
var_dump_json($users->distinct('name'));
FYI
DAO = Data Access Object
SQL Translation
IDao A Single Row within the database
IDataStore The Table within the database
IDataConection The connection to the database server e.g. PDO