1. Go to this page and download the library: Download selami/entity 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/ */
declare(strict_types=1);
namespace MyLibrary\ValueObject;
use Selami\Entity\ValueObjectBuilder;
final class CreditCard
{
private static $schemaFile = './models/credit-card.json';
public static function create() : ValueObjectBuilder
{
return ValueObjectBuilder::createFromJsonFile(self::$schemaFile);
}
}
declare(strict_types=1);
namespace MyLibrary\Entity;
use Selami\Entity\Interfaces\EntityInterface;
use stdClass;
use Selami\Entity\Model;
use Selami\Entity\EntityTrait;
final class Profile implements EntityInterface
{
private static $schemaFile = './models/profile.json';
use EntityTrait;
public static function create(string $id, ?stdClass $data=null) : EntityInterface
{
$model = Model::createFromJsonFile(self::$schemaFile);
return new static($model, $id, $data);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.