-
Notifications
You must be signed in to change notification settings - Fork 281
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
Clone cards while cloning boards #3691
Conversation
Signed-off-by: Luka Trovic <[email protected]>
$newCard = new Card(); | ||
$newCard->setTitle($card->getTitle()); | ||
$newCard->setStackId($insertedStack->getId()); | ||
$newCard->setType($card->getType()); | ||
$newCard->setOrder($card->getOrder()); | ||
$newCard->setOwner($card->getOwner()); | ||
$newCard->setDescription($card->getDescription()); | ||
$newCard->setDuedate($card->getDuedate()); | ||
$newCard = $this->cardMapper->insert($newCard); |
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.
We can isolate this process in a method inside Card
entity.
$newCard = new Card(); | |
$newCard->setTitle($card->getTitle()); | |
$newCard->setStackId($insertedStack->getId()); | |
$newCard->setType($card->getType()); | |
$newCard->setOrder($card->getOrder()); | |
$newCard->setOwner($card->getOwner()); | |
$newCard->setDescription($card->getDescription()); | |
$newCard->setDuedate($card->getDuedate()); | |
$newCard = $this->cardMapper->insert($newCard); | |
$newCard = new Card(); | |
$newCard->setFromCard($card); | |
$newCard->setStackId($insertedStack->getId()); | |
$newCard = $this->cardMapper->insert($newCard); |
or
$newCard = new Card(); | |
$newCard->setTitle($card->getTitle()); | |
$newCard->setStackId($insertedStack->getId()); | |
$newCard->setType($card->getType()); | |
$newCard->setOrder($card->getOrder()); | |
$newCard->setOwner($card->getOwner()); | |
$newCard->setDescription($card->getDescription()); | |
$newCard->setDuedate($card->getDuedate()); | |
$newCard = $this->cardMapper->insert($newCard); | |
$newCard = Card::copyFrom($card); | |
$newCard->setStackId($insertedStack->getId()); | |
$newCard = $this->cardMapper->insert($newCard); |
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.
Yes. But Card is a RelationalEntity. Only accessors and mutators should be defined in it I think. I wanted to add it in CardService but CardService is already using BoardService so there is a dependency issue. What I think is to add a new layer or put it into CardMapper (but mappers are meant to be the ORM layer I think).
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.
I see, you are right
Looks like we need to think more about it to create a wise solution.
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.
I think we can put the logic in a function just in case we need to isolate later on in a class.
As discussed in the call, lets:
|
@luka-nextcloud As discussed lets rather focus on getting #3430 in as it also contains various options on the UI. |
Signed-off-by: Luka Trovic [email protected]
Summary
Duplicating a board copies its lists, but not the card.
Checklist