PHP code example of sinema / data-entities

1. Go to this page and download the library: Download sinema/data-entities 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/ */

    

sinema / data-entities example snippets


use Sinemah\DataEntities\Data;

class Message extends Data
{
    public string $text;
    public string $user;
    public int $created_at;
}

use Sinemah\DataEntities\Data;
use Sinemah\DataEntities\Entity\Requireable;

class Message extends Data
{
    use Requireable;

    protected array $

$message = Message::from(['user' => 'John Smith', 'text' => 'Lorem Ipsum']);

$message->toArray();

$message->get('user');