1. Go to this page and download the library: Download delboy1978uk/bone-doctrine 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/ */
delboy1978uk / bone-doctrine example snippets
// use statements here
use Bone\BoneDoctrine\BoneDoctrinePackage;
return [
'packages' => [
// packages here...,
Bone\BoneDoctrine\BoneDoctrinePackage::class,
],
// ...
];
/**
* Returns a list of fixtures by classname, in the order of their execution
*/
use Fixtures\LoadUsers;
return [
'fixtures' => [
LoadUsers::class,
],
];
use Bone\BoneDoctrine\Attributes\Cast;
use Bone\BoneDoctrine\Attributes\Visibility;
use Bone\BoneDoctrine\Traits\HasId;
use Del\Form\Field\Attributes\Field;
use Del\Form\Traits\HasFormFields;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
class SomeEntity
{
use HasFormFields;
use HasId;
#[ORM\Column(type: 'float')]
#[Field('float|
declare(strict_types=1);
namespace Bone\App\Service;
use Bone\App\Entity\Test;
use Bone\BoneDoctrine\Service\RestService;
class SomeEntityService extends RestService
{
public function getEntityClass(): string
{
return SomeEntity::class;
}
}
declare(strict_types=1);
namespace Bone\App\Http\Controller;
use Bone\App\Entity\SomeEntity;
use Bone\App\Service\SomeEntityService;
use Bone\BoneDoctrine\Http\Controller\AdminController;
class TestAdminController extends AdminController
{
public function getEntityClass(): string
{
return SomeEntity::class;
}
public function getServiceClass(): string
{
return SomeEntityService::class;
}
}
public function addRoutes(Container $c, Router $router): Router
{
// other routes here....
$router->adminResource('some-entities', TestAdminController::class, $c);
}
declare(strict_types=1);
namespace Bone\App\Http\Controller\Api;
use Bone\App\Service\PersonService;
use Bone\Http\Controller\ApiController;
class PersonController extends ApiController
{
public function getServiceClass(): string
{
return PersonService::class;
}
}
declare(strict_types=1);
namespace Bone\App\Service;
use Bone\App\Entity\Person;
use Bone\BoneDoctrine\Service\RestService;
class PersonService extends RestService
{
public function getEntityClass(): string
{
return Person::class;
}
}
public function addRoutes(Container $c, Router $router): Router
{
$router->apiResource('people', PersonController::class, $c);
return $router;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.