Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

MySQL ORM library with Database First model that lets you create Entities with complex relationships and queries.

License

NotificationsYou must be signed in to change notification settings

GregaMohorko/BlueDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A PHP MySQL ORM library with Database First model that lets you create Entities with base properties and complex relationships (One-To-Many,Many-To-One,Many-To-Many,Table Inheritance,Associative tables), supports queries with expressions, JSON encoding/decoding and is simple to use.

Check theBlueDBClient.NET for a .NET client library to use on the .NET client side.

Release

Documentation & Tutorials

You can read the documentation and tutorials under theWiki.

Short examples

Let's assume that we have an entityUser.

Loading all entries:

$all = User::loadList();

This would load all entries with all fields.

Let's say that we want only theUsername fields:

$all = User::loadList([User::UsernameField]);

How about loading only those users, whoseUsername starts with "Ja"?

Simple, we use theCriteria class:

$criteria =newCriteria(User::class);$criteria->add(Expression::startsWith(User::class, User::UsernameField,"Ja"));$results = User::loadListByCriteria($criteria);

Encoding/decoding entities to/from JSON? No problem!

$json =JSON::encode($entity);$entity =JSON::decode($json);

Creating a new entry:

$gordon =newUser();$gordon->Username ="Gordon";User::save($gordon);

Updating entries:

// let's change Gordons username to 'Freeman'$gordon->Username ="Freeman";User::update($gordon);

Deleting entries:

// let's delete GordonUser::delete($gordon);

These short examples are just the top of the iceberg, BlueDB has many many more cool features. To find them out and for more complex examples & tutorials, please go toWiki.

Requirements

PHP version >= 5.5

Author and License

Gregor Mohorko (www.mohorko.info)

Copyright (c) 2022 Gregor Mohorko

Apache License 2.0


[8]ページ先頭

©2009-2025 Movatter.jp