PHP code example of falseclock / dbd-php-entity

1. Go to this page and download the library: Download falseclock/dbd-php-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/ */

    

falseclock / dbd-php-entity example snippets


$item['currency_name'];
$item['currency_symbol'];

$objects = [];
foreach ($array as $item) {
    $objects[] = new Currency($item);
}
// обращаться к значениям теперь можно так: 
$objects[0]->name;
$objects[0]->symbol;


class City extends Entity {

}

class CityMap extends Mapper
{
    const ANNOTATION = "Data description";
}

public __get(string $property): mixed

/**
 * Class MapperGet
 * @property Embedded $Regions
 * @property Complex $Address
 */
class MapperGet extends Mapper
{
    const ANNOTATION = "Data description";

    /** @var Embedded */
    protected $Regions = [
        Embedded::NAME => "country_regions",
        Embedded::ENTITY_CLASS => Region::class,
    ];

    /**  @var Complex */
    protected $Address = [
        Complex::TYPE => Address::class,
    ];
}

public findColumnByOriginName(string $originName): Column

public getAllVariables(): MapperVariables

public getAnnotation(): string

public getColumns(): array

public getComplex(): array

public getConstraints(): array

public getEmbedded(): array

public getEntityClass(): string

public getOriginFieldNames(): array
bash
composer