Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Doctrine 2 with FuelPHP
  • I just finished several huge improvements of aspendigital/fuel-doctrine2 wrapper library.

    My fork with those improvements can be found
    Also I sent pull request and hopefully it will be merged

    In short: library now can be installed with composer and used with \Fuel\Doctrine::manager();
    Configuration options very improved and no need to handle 2 config files anymore. Everything in Fuel db.php

    Please see README and pull request for more information.
    Hope it will be useful :)

  • Are there any more details docs and examples of how this is used?

  • What exactly isn't clear for you?

    Did you read readme at ?
    For me it seems good :)

    Once you've set up everything you just take EntityManager and use it like usually would do with Doctrine

    $Result = \Fuel\Doctrine::manager()->getRepository('entity\some')->find($id);

    PS. my PR was merged but with some changes :P
  • It does sound simple enough, but I guess what I am getting at is:

    - I assume that models are now build to the doctrine standards, right?

    - **** Will Oil still work to create the models, scaffolding, etc?  <----- This is really the main question I have.


  • Not really, because they're alternatives either you use Fuel models and such or use Doctrine with all it's provided functionality, but I guess you probably could make them both working with same tables only some extra work will be required to configure it so.

    When you use Doctrine then similar to Oil functionality is provided by `doctrine` PHP script. ie.
    php doctrine orm:schema-tool:create

    PS. if you're not familiar with Doctrine then I probably wouldn't suggest using it with FuelPHP

  • I dont know what happened to my reply but here it is again:

    I'm familiar with Doctrine which is why I'm looking to use it.

    But just to be clear: if you use Doctrine, you lose all 'Generate' and 'Refine' Oil capabilities pretty much, right?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion