Coder Social home page Coder Social logo

generatorbundle's People

Contributors

remg avatar yhoiseth 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

Watchers

 avatar  avatar

Forkers

yhoiseth fodger

generatorbundle's Issues

Exits with "Trying to get property of non-object"

Hi,

After invoking php bin/console remg:generate:entity, whatever I type as the name of the entity, I now get:

In ClassMetadataInfo.php line 3265:

Notice: Trying to get property of non-object

And the command exits.

I have used remg generator before with success, but now I get this when trying to use it on any new Symfony 3.4 project. Is this easily fixable? In light of the new entity generation tools in Symfony 4, is remg generator bundle now an abandoned project?

Thanks for any help!

Jamie

Are no-interaction commands allowed/Integrated?

Can I use your bundle like follows?

php bin/console doctrine:generate:entity --entity AppBundle:Account --no-interaction --format=annotation --fields="accountTypeId:integer accountNumber:integer title:string(length=255) description:text createdAt:datetime updatedAt:datetime" ___ relation Related"" ___

The bundle does not work if the project is not in a bundle (symfony 3.4+)

When I use this bundle with symfony 3.4, I get the following error when trying to create an entity.

 Entity name:
 > App\Entity\Post


 [ERROR] The bundle "App" does not exist.

In symfony 3.4+, the concept of bundle for the main app is deprecated.

Do you want some help to repair the bundle ? I found it very useful for my students, especialy when they are complete beginners.

Generator suggests singular form instead of plural form

When I add a OneToMany association mapping to the Post class, between Post and Category classes, I expect the generator to suggest the plural form for the inverse mapping part : posts, and not post.

 Association name:
 > categories

 Association type [OneToMany]:
  [0] OneToOne
  [1] ManyToOne
  [2] OneToMany
  [3] ManyToMany
 > 2

 Target entity [AppBundle:Category]:
 > 

 Bidirectional ? (yes/no) [yes]:
 > 

 Mapped by : [post]:
 > posts

Except this little detail, this is a nice tool to have. I find it quite complicated to teach all those annotations to complete beginners. I usually end up correcting their code myself. I was even thinking about creating something like this. Nice work ๐Ÿ‘

Expecting fluent design pattern on every setter methods

When I add a *ToMany association mapping on the Tag class, between Tag and Post classes, the generator creates a remove*() method wich does not return $this :

    /**
     * Remove post
     *
     * @param \AppBundle\Entity\Post $post
     */
    public function removePost(\AppBundle\Entity\Post $post)
    {
        $this->posts->removeElement($post);
    }

This is better :

    /**
     * Remove post
     *
     * @param \AppBundle\Entity\Post $post
     *
     * @return Tag
     */
    public function removePost(\AppBundle\Entity\Post $post)
    {
        $this->posts->removeElement($post);

        return $this;
    }

Missing method when adding a `ManyToMany` association

When I add a ManyToMany association mapping to the Post, class between Post and Category classes, I expect the generator to add also this method :

    /**
     * Set tags
     *
     * @param \AppBundle\Entity\Tag $tags
     *
     * @return Category
     */
    public function setTags(\AppBundle\Entity\Tag $tags = null)
    {
        $this->tags = $tags;

        return $this;
    }

Missing method when adding a `ManyToOne` association

When I add a ManyToOne association mapping to the Category, class between Category and Post classes, I expect the generator to add also these methods :

    /**
     * Add post
     *
     * @param \AppBundle\Entity\Post $post
     *
     * @return Post
     */
    public function addPost(\AppBundle\Entity\Post $post)
    {
        $this->posts[] = $post;

        return $this;
    }

    /**
     * Remove post
     *
     * @param \AppBundle\Entity\Post $post
     */
    public function removePost(\AppBundle\Entity\Post $post)
    {
        $this->posts->removeElement($post);
    }

Note, that I expect the same for the inverse (owned) side.

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.