Giter Club home page Giter Club logo

breeze.server.php's Introduction

React, Vue, TypeScript/JavaScript and PHP

I have been working as a developer for 14+ years including 9+ years remote working experience. I'm used to work comfortably 12+ hours per day.

I have developed:

  • ๐Ÿ“ฑ Mobile Apps with Cordova, React Native and Java (for Android)
  • ๐ŸŒ (Progressive) Web Apps with Vue, React, TypeScript/JavaScript and PHP
  • ๐Ÿ–ฅ๏ธ Desktop Apps with Electron and C# Forms
  • ๐Ÿ”จ Frameworks, Libraries and Tools (that were used by developers)

Feel free to reach out to me if:

  • You have a project to work with
  • You want consultancy in your next big software
  • You want help with your existing product/project

You can contact me via:

https://zetmel.com

breeze.server.php's People

Contributors

safrazik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

breeze.server.php's Issues

Cool

Sounds like a very very good start. I am willing to help, I need the same thing to save in a mysql db. Could you kindly provide a bit more information ?.

A index.php that will contain the JS used to load the schema and run the save and the SQL to create the DB background would be just perfect to help me to go forward.

Thx for your much appreciated efforts here

Child entity types define the inherited navigation properties again

e.g:

namespace Test\Model;

class Address {
}

class Person {
  protected $firstName; // string
  protected $address; // instance of Address
}

class Employee extends Person {
}

the metadata generated is

{
  "structuralTypes": [
    {
      "shortName": "Person",
      "namespace": "Test.Model",
      "dataProperties": [
        {
          "name": "firstName",
          "dataType": "String"
        }
      ],
      "navigationProperties": [
        {
          "name": "address",
          "entityTypeName": "Address:#Test.Model",
          "isScalar": true
        }
      ]
    },
    {
      "shortName": "Employee",
      "baseTypeName": "Person:#Test.Model",
      "namespace": "Test.Model",
      "dataProperties": [ ],
      "navigationProperties": [
        {
          "name": "address",
          "entityTypeName": "Address:#Test.Model",
          "isScalar": true
        }
      ]
    }
  ]
}

while navigation property address is inherited from Person entity, Employee entity should not define it again. This is already working with dataProperties

isPartOfKey not being set correcting for keys in Embeddable properties

I have my keys stored in a UUID value object. When this is generating the metadata, the isPartOfKey flag is not being properly set for the classes.

Example:

/**
 * @Entity
 * @HasLifecycleCallbacks()
 **/
class Expense extends Base
{
    /**
     * @Embedded(class="Objects\UUID", columnPrefix=false)
     * @var UUID
     **/
    protected $id;
   ....
}
/**
 * @Embeddable
 */
class UUID
{
    /**
     * @Id
     * @Column(type="string")
     */
    private $id;

   ...
}

The generated Metadata looks like this:

{
"metadataVersion":"1.0.5",
"structuralTypes":[{
   "shortName":"Expense",
   "autoGeneratedKeyType":"None",
   "defaultResourceName":"Expenses",
   "dataProperties":[
      {"name":"id","dataType":"String"}
      ...
   ]
}

It appears that Embeddables aren't being evaluated correctly.

MetadataBuilder doesn't support simple array data properties

I'm working on a project which uses BreezeJS and the breeze.server.php bundle to generate the Breeze metadata from Doctrine mappings which is really awesome, but now I'm running into a use case where I need to have a simple array data property, in fact a simple array of strings.

In BreezeJS this is supported via an extra property in the metadata for a certain DataProperty ('isScalar = false" => http://stackoverflow.com/questions/22055013/breeze-js-metadata-by-hand-for-an-array-type) but I can't get this property added via the breeze.php.library as there is no "isScalar" property in the DataProperty class of the library.

Do you think this property could be added to the DataProperty class?

Triggering Events?

I'm considering using this for an upcoming project, but there's one last thing I'm not seeing how to do using this library and breeze that I'm hopeful someone can shed some light on. I need a way to be able to trigger an event in php from breeze. I'm all set with using the events on the back-end, I just don't see a way to get them to run from the front-end.

Probably the best example I can give is a tournament. Once all of the matches for a round are done I'd show the user a button to progress to the next round, which would send a request to the server to do all the work of figuring out the matches and then respond with the next round.

Ideally on the front-end I could have a progress method on the tournament entity, and calling that would trigger a Symfony event somehow.

Any ideas on how something like this can be accomplished?

[feature] Custom Services And non-mapped properties

This library has been working out pretty great sitting in a laravel 5 project. Just a couple improvements could make it exceed endlessly... It'd be cool if you could create service endpoints that return arrays of objects (think Lookups). The example in the demo is OK but highly ineffceient for a large lookup set .. (talking 10+ queries) which could be exacted in one lookup service..

Also I notice if you put a property on the doctrine class but don't specify a doctrine @column tag it still sends the data down in the metadata.. I personally think this or perhaps something more clever could be useful for sending unmaped properties . Since per the breeze docs you can't get tracking on unmaped properties unless they come down from the server side...

Status of Build?

I stumbled across this project when searching for "breeze php," and it seems to be exactly what I was looking for. However, I'm wondering what the status of the code is? I don't see any test cases, and the project as a whole seems to have come out of the blue. Is it being used in production somewhere?

The readme mentions that the project supports a subset of OData queries. Does this affect the use of Breeze? On the whole does this implement an OData producer library for PHP? I had come across https://github.com/balihoo/POData, but that seemed to have issues / was lacking documentation. It looks like this may include some code from there.

Add support for automatic handling of bidirectional associations

As mentioned in the Doctrine documentation, it is required to update both sides of a bidirectional association:

// Many-To-One / One-To-Many Bidirectional
$newComment = new Comment();
$user->getAuthoredComments()->add($newComment);
$newComment->setAuthor($user);

Currently the breeze.server.php library has support for assigning from the owning side only.

$newComment = new Comment();
$newComment->setAuthor($user);

While this is not a problem in a usual scenario, it can be very useful when lifecycle callbacks are involved.

composer - no matching packages

Upon executing composer update, the following error shows up:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for symfony/validator dev-master -> satisfiable by symfony/validator[dev-master].
- symfony/validator dev-master requires symfony/translation ~2.8|~3.0 -> no matching package found.
Problem 2
- Installation request for adrotec/breeze.server.php dev-master -> satisfiable by adrotec/breeze.server.php[dev-master].
- adrotec/breeze.server.php dev-master requires jms/serializer ~1.0 -> no matching package found.

Perhaps your package should depend on stable releases instead of dev-master? I changed "dev-master" to "@dev" and it temporarily fixes the problem, for the lack of any better/quicker solution, if that can be called so.

It's acutally an issue with the demo: https://github.com/adrotec/breeze.server.php.demo

Many TO Many

Should probably be documented that many to many doesn't work

Authorization

Is there a way to do authorization with this as well? I see that there is data validation, but I don't see any authorization. It seems like the Breeze way is to do 'Save Interception'. Is that supported?

Is it possible to include navigation property IDs in projection query?

From @slawojstanislawski on September 5, 2015 11:54

Here's a link from a project built with MongoDb, angular and breezeJs:
https://github.com/johnpapa/ng-demos/blob/master/cc-bmean/src/client/app/data/repositories/repository.session.js#L65

On line 65 in the code, as part of a projection selection there are navigation properties' IDs included. So one can first download all the track, timeSlot and room entities (say, as part of some lookup query, as was provided as an example for a PHP app here: #12 (comment)), and then ask for such a projection, and since the navigation properites' entities are in the cache, one can make use of, say, session.timeSlot.name, or session.track.title, things like that, and the navigation properties are retrieved from cache appropriately for a given session (after casting the query result to session entity with toType() method).

In my sandbox model (based on EmpDirectory sample app) User entity has ManyToOne association with Job entity and a ManyToOne association with Department entity, and when I do:
breeze.EntityQuery.from('Users').toType("User")
with no projection, I get properties like jobId and departmentId in the results. When I try to use projection:
breeze.EntityQuery.from('Users').select('id, firstName, lastName, jobId').toType("User")
I get 500 server response:
Invalid select expression "X.lastName" (500 Internal Server Error)

There's clearly something I'm missing but I've been unable to pinpoint exactly what it is.

Copied from original issue: adrotec/AdrotecWebApiBundle#2

Serialization of entities after SaveChanges includes associations

In the serialized json response after SaveChanges, only the entities that were sent to the server, should be returned with the updated values. At the moment, the serialized entities also include the associations.

It becomes problematic when one to many associations are available. A big payload can break things. Could be a side effect of this feature #6 Add support for automatic handling of bidirectional associations

Hint: Introduce serialization contexts for SaveChanges, Metadata and Query Results

No Tests

No (unit) tests are available yet

Assitance with install of Emploee Directory

Forgive me if this is the worng place to post this -

I am having trouble installing the PHP Employee Directory which is located here:
http://emp-directory.herokuapp.com/

In the directions it says : run composer update from server/standalone directory.

How is that accoplished exactly? I tried to run it from the url but I get a 404. Am I supposed to do this at a command line? I'm installing into a WAMP environment.

Thanks for any help

Compatibility with PHP 7

This is not to breeze.server.php but to your fork of odataphpprod (that fork not has Issues tab).

I get next error when try run code on the PHP 7
Fatal error: Cannot use ODataProducer\Providers\Metadata\Type\String as String because 'String' is a special class name in vendor\adrotec\odataphpprod\library\ODataProducer\Providers\Metadata\ResourceType.php on line 47
Can this will be fixed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.