1. Go to this page and download the library: Download wscore/dbaccess library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$user = User::forge();
// use $dao as iterator.
foreach( $user->active() as $applied ) {
echo $applied->name;
}
class User extends
public function on{EventName}Hook( $data ) {
}
}
class User extends
public function on{EventName}Filter( $data ) {
return $data;
}
}
// $hookObject has the events and scopes.
$user->setHook( $hookObject );
class YourDao extends Dao
{
public function getTargetsRelation() {
return Relation::HasOne( $this, 'TargetDaoName' );
}
}
$dao = new YourDao();
$entity = $dao->find($id);
// get target record using HasOne relation.
$targets = $dao->getTargetsRelation()->entity( $entity )->get();
// or use EntityObject's magic method.
$targets = $entity->targets->get();
$entity->targets->link( $targetEntity );
DB::db()->transaction( function() {
// do database access.
} );
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.