Comments (13)
Hi,
can you give your example entity? Thanks!
from entityauditbundle.
Here is the mapping :
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping" >
<entity name="Oru\Bundle\CustomBundle\Entity\Demande" table="oru_custom_demande" repository-class="Oru\Bundle\CustomBundle\Entity\DemandeRepository" >
<id name="id" type="integer" column="id">
<generator strategy="AUTO"/>
</id>
<field name="statut" type="string" length="20" nullable="true" />
<field name="deletedAt" column="deleted_at" type="datetime" nullable="true" />
<gedmo:soft-deleteable field-name="deletedAt" />
</entity>
</doctrine-mapping>
And the EntityAudit configuration :
simple_things_entity_audit:
audited_entities:
- Oru\Bundle\CustomBundle\Entity\Demande
The php class for this entity is auto-generated via doctrine :
namespace Oru\Bundle\CustomBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
class Custom {
/**
* @var integer
*/
private $id;
/**
* @var string
*/
protected $statut;
/**
* @var \DateTime
*/
private $deletedAt;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @param string $statut
*/
public function setStatut($statut)
{
$this->statut = $statut;
}
/**
* @return string
*/
public function getStatut()
{
return $this->statut;
}
/**
* Set deletedAt
*
* @param \DateTime $deletedAt
* @return Demande
*/
public function setDeletedAt($deletedAt)
{
$this->deletedAt = $deletedAt;
return $this;
}
/**
* Get deletedAt
*
* @return \DateTime
*/
public function getDeletedAt()
{
return $this->deletedAt;
}
}
Thanks !
from entityauditbundle.
@arlin2050 , as you can see in #113, everything works fine (however your use case allowed to find at least one bug).
It seems I can not repeat your issue. Can you update doctrine / EA to latest versions and check again? Can you provide a test that 100% repeats the issue?
Thanks!
from entityauditbundle.
Thanks for the reply. I'll try to update doctrine and check again.
from entityauditbundle.
@arlin2050 , what's the status on this? )
from entityauditbundle.
Hi,
My doctrine/orm version is v2.3.6. It's the latest possible version of doctrine for my installation which depends on Symfony 2.3 LTS.
EntityAudit version is up to date with dev-master.
Lauching unit tests, I've got two errors :
- SimpleThings\EntityAudit\Tests\IssueTest::testIssue111
ReflectionException: Method prepareUpdateData does not exist
vendor/simplethings/entity-audit-bundle/src/SimpleThings/EntityAudit/EventListener/LogRevisionsListener.php:114
vendor/doctrine/common/lib/Doctrine/Common/EventManager.php:59
vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:364
vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:355
vendor/simplethings/entity-audit-bundle/tests/SimpleThings/Tests/EntityAudit/IssueTest.php:75
- SimpleThings\EntityAudit\Tests\IssueTest::testIssue9
ReflectionException: Method prepareUpdateData does not exist
vendor/simplethings/entity-audit-bundle/src/SimpleThings/EntityAudit/EventListener/LogRevisionsListener.php:114
vendor/doctrine/common/lib/Doctrine/Common/EventManager.php:59
vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:364
vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:355
vendor/simplethings/entity-audit-bundle/tests/SimpleThings/Tests/EntityAudit/IssueTest.php:146
Thanks
from entityauditbundle.
Ok, please see #115, this should fix the issue.
from entityauditbundle.
Applying the three commits available in #115, I've got this error :
FatalErrorException: Error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in vendor/simplethings/entity-audit-bundle/src/SimpleThings/EntityAudit/EventListener/LogRevisionsListener.php line 160
Real exception is :
Could not resolve database type for column "deleted_at" during extra updates
I've got this error because I use the property name on a column, and my column deletedAt in database is not camel case but 'deleted_at'. Maybe another issue ?
Thanks
from entityauditbundle.
Still the same entity yet with @Column(type="datetime", name="deleted_at")
?
from entityauditbundle.
...anyway, please check #116 )
from entityauditbundle.
Still the same entity yet with @column(type="datetime", name="deleted_at") ?
Yes
from entityauditbundle.
...anyway, please check #116 )
It works, thanks.
When will this be available on master ?
from entityauditbundle.
it's already merged into master.
from entityauditbundle.
Related Issues (20)
- What happened to this project? It is transfer to `sonata-project`. HOT 4
- Audit tables are being generated for all entities, not just the ones specified in config HOT 3
- Support Annotations HOT 4
- Compare Revision (`CompareAction`) route not working HOT 11
- Identical Dates should not create a revision HOT 2
- Integration with EasyAdminBundle ? HOT 5
- Argument 3 passed to SimpleThings\EntityAudit\Revision::__construct() must be of the type string, null given HOT 3
- The "security.token_storage" service or alias has been removed or inlined when the container was compiled. HOT 1
- Extending revision entity/table. HOT 1
- Auditing an entity which uses foreign key as primary key fails HOT 2
- Ignore fields option not working HOT 8
- Support for translatable entities HOT 1
- Many To Many audit relation fail with new entity in the relation. HOT 9
- View changes not showing HOT 1
- Support for `doctrine/collections` ^2.0 HOT 1
- Incompatible with Lazy-Loading Proxies (Ghost)? HOT 10
- Doctrine ORM 3 support HOT 2
- Ignore related tables for auditiong HOT 2
- Multiple many-to-many relationships to same table causes DUPLICATE KEY error.
- spl_object_id() expects parameter 1 to be object, string given in PHP 7.4 and version AuditBundle 1.12 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from entityauditbundle.