[WIP] Feature: Lifecycle Callbacks #61

Open
wants to merge 5 commits into
from

Projects

None yet

3 participants

@DavidBadura

It would be very useful to have DoctrineORM Lifecycle Callbacks in CouchdbODM, too.
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html#lifecycle-callbacks

See issue #60

@beberlei beberlei commented on an outdated diff Feb 24, 2013
...CouchDB/Mapping/Annotations/HasLifecycleCallbacks.php
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\ODM\CouchDB\Mapping\Annotations;
+
+use Doctrine\Common\Annotations\Annotation;
+
+/**
+ * @Annotation
+ */
+final class HasLifecycleCallbacks extends Reference
@beberlei
beberlei Feb 24, 2013 Member

extends Reference is wrong, it has to be extends Annotation. Same for all the other new annotation classes.

@beberlei beberlei commented on the diff Feb 24, 2013
lib/Doctrine/ODM/CouchDB/UnitOfWork.php
@@ -964,12 +972,15 @@ private function computeAssociationChanges($assoc, $value)
* @param object $document
* @return void
*/
- public function persistNew($class, $document)
+ private function persistNew($class, $document)
@beberlei
beberlei Feb 24, 2013 Member

Can you explain this change?

@DavidBadura
DavidBadura Feb 24, 2013

it makes no sense that this method is public. In the other projects of Doctrine is this method private. This is an internal method and I do not see why they should be public. It looks more like an error.

@dbu
Member
dbu commented May 10, 2013

the fix about inheriting metadata is now in master with #65 . i guess this PR needs an update now.

@DavidBadura

Okay, i try on the weekend to continue. thank you!

@dbu
Member
dbu commented May 10, 2013

i am very glad you found where the issue was, david. i just copied the code over from your PR.

@smoench smoench referenced this pull request Jul 25, 2016
Open

Lifecycle callbacks #123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment