-
Notifications
You must be signed in to change notification settings - Fork 3
New Transit::attach() method to attach domain to the current context #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 0.x
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,6 +68,24 @@ public function select(string $domainClass, array $whereEquals = []) : TransitSe | |
| ); | ||
| } | ||
|
|
||
| /** | ||
| * Attach a domain object to plan. | ||
| * | ||
| * @param \Atlas\Transit\object $domain | ||
| * | ||
| * @return \Atlas\Transit\Transit | ||
| * @throws \Atlas\Transit\Exception | ||
| */ | ||
| public function attach(object $domain): Transit | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see a problem here: which method should the end user use?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like Doctrine; it's needed to "attach" ("merge" with Doctrine) the entity to Transit before modification.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you have an another suggestion of method name, i'm ready :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doctrine no longer works as an example, because https://github.com/doctrine/orm/blob/master/UPGRADE.md#bc-break-removed-entitymanagermerge-and-entitymanagerdetach-methods
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes i see that 👍 . There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See also at Doctrine:
…and this is the path you should go.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not too similar to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You are on the right track. 😉
…and the entire pull request is not needed. |
||
| { | ||
| $handler = $this->handlerLocator->get($domain); | ||
| /** @var \Atlas\Mapper\Record $record */ | ||
| $record = $handler->updateSource($domain, $this->plan); | ||
| $record->getRow()->init(''); | ||
|
|
||
| return $this; | ||
| } | ||
|
|
||
| // PLAN TO insert/update | ||
| public function store(object $domain) : void | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class doesn't exists
\Atlas\Transit\object. Useobjectinstead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed ;)
Due to #14