analogueorm / analogue

Analogue ORM : Data Mapper ORM for Laravel/PHP
MIT License
632 stars 51 forks source link

Documentation Request #223

Open Insolita opened 6 years ago

Insolita commented 6 years ago

I'll just describe here the most obscure points

  // ...
  public function setStatus(StatusObject $status){
       $this->status = $status->getValue();
       $this->code = $status->getCode();
  }
  public function getStatus():StatusObject{
       return new StatusObject($this->status, $this->code);
  }

Of course, embedded objects are resolved automatically, but in some cases they can bring overhead?

RemiCollin commented 6 years ago

Noted!

Quickly Aabout repositories, I felt that they should belong to the application layer, and that the package should not be opinionated on their implementation. Also using repositories is totally up to the user, and mostly depends on application design choices, thus the deprecation

quetzyg commented 6 years ago

Totally agree with @RemiCollin. The user should be responsible for creating the repositories (if they see fit).

Insolita commented 6 years ago

I also agree. First, each repository should have the correct phpdoc type hints for the find * methods and we were forced to override the parent methods for convenient work. Anyone can write generator with core methods