Bug #29908

@HasLifecycleCallbacks and Doctrine2-Events like @PrePersist don't work.

Added by Martin Br├╝ggemann about 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Must have
Category:
Persistence
Start date:
2011-09-16
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

If you activate @HasLifecycleCallbacks in your model and build a @PrePersist function like the following one - it doesn't work (or I'm to stupid to get it work ;)

<?php
declare(ENCODING = 'utf-8');
namespace Test\Animals\Domain\Model;

/**
 * @scope prototype
 * @entity
 * @HasLifecycleCallbacks
 */
class AnimalOwner {

    [...] 

    /**
     * @PrePersist
     */
    public function beforePersist(){
    echo "I don't have a cat.";
    exit;
    }
}

Or is there something missing in my model code?

#1

Updated by Karsten Dambekalns about 10 years ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow
  • Status changed from New to Accepted

That should work, so congratulations on probably finding a bug :) I'll check!

#2

Updated by Karsten Dambekalns about 10 years ago

  • Category set to Persistence
  • Target version set to 1.0.0
#3

Updated by Mr. Hudson about 10 years ago

  • Status changed from Accepted to Under Review

Patch set 1 of change I6f2920069ae8c0470cc4626e0d7e9ff4ae33761a has been pushed to the review server.
It is available at http://review.typo3.org/5063

#4

Updated by Karsten Dambekalns about 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF