2017 © Pedro PelĆ”ez
 

library ventriloquist

image

adelf/ventriloquist

  • Friday, June 1, 2018
  • by AmadeusDelfino
  • Repository
  • 1 Watchers
  • 2 Stars
  • 67 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 1240 % Grown

The README.md

Ventriloquist

Build Status StyleCI, (*1)

Suporte para fornecer uma interface Ćŗnica para consultas no banco de dados que utilizam ORMs com suporte a dotnotation (como o Eloquent), (*2)

Exemplo de uso

{
    "values": [
      {
        "name": "name"
      },
      {
        "name": "last_name"
      },
      {
        "name": "salary"
      },
      {
        "name": "email"
      }, 
      {
        "name": "vacation",
        "select": [
          "id",
          "start_date",
          {
            "name": "allowance",
            "select": [
              "id"
            ]
          }
        ]
      }
    ]
}

Como o Ventriloquist foi desenvolvido orientado a microserviƧos que utilizam mensageria (de forma reativa), eis um exemplo de utilizaĆ§Ć£o em JSON, considerando que o padrĆ£o de mensagens utilizado seja JSON., (*3)

Um array PHP que vai gerar um JSON dessa forma Ć© o seguinte:, (*4)

  array (
    0 => 
    array (
      'name' => 'name',
    ),
    1 => 
    array (
      'name' => 'last_name',
    ),
    2 => 
    array (
      'name' => 'salary',
    ),
    3 => 
    array (
      'name' => 'email',
    ),
    4 => 
    array (
      'name' => 'vacation',
      'select' => 
      array (
        0 => 'id',
        1 => 'start_date',
        2 => 
        array (
          'name' => 'allowance',
          'select' => 
          array (
            0 => 'id',
          ),
        ),
      ),
    )

ImplementaĆ§Ć£o

$parser = new Generator();
$parser->query($arrayQuery);
$parser->rootModel(new \My\Root\Model());
$parsed = $parser->parse();

return $parsed->eloquentBuilder()->limit(10)->get();

The Versions

01/06 2018

dev-add-type

dev-add-type

  Sources   Download

MIT

The Requires

 

The Development Requires

by Amadeus Delfino

28/05 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Amadeus Delfino

28/05 2018

1.1.1

1.1.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Amadeus Delfino

28/05 2018

1.1.0

1.1.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Amadeus Delfino

27/05 2018

1.0.3

1.0.3.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Amadeus Delfino

27/05 2018

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

 

by Amadeus Delfino

27/05 2018

1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

 

by Amadeus Delfino

27/05 2018

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

by Amadeus Delfino