Organization repository for discussions
somnambulist-tech / laravel-doctrine-entity-audit Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Lesser General Public License v2.1
License: GNU Lesser General Public License v2.1
Hi!
I was hoping you could help me with what I'm doing wrong. I followed the steps in the readme;
php artisan vendor:publish
entity_audit.entity_managers.default.entities
php artisan doctrine:migrations:diff
But here's where it goes wrong; The migration that has been generated contains no audit tables at all. Is there anything that I'm missing?
Hi! It's me again. I have another thing I ran into. We have a Product table that has a nullable field called Default
. Aaaand default
happens to be a keyword in SQL too, so I believe it is failing on this.
An exception occurred while executing 'UPDATE revision_audit_Product SET default = ? WHERE rev = ? AND id = ?' with params [null, "26", redacted]:SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'default = NULL WHERE rev = '26' AND id = redacted' at line 1
This only happens with this specific tables. All revisions on all other tables are logged correctly.
Hi!
So, question in title.
I can't use global attribute because of this attribute has several models.
Thx
Hi! Sorry to bother you with more questions/requests. We have run into 2 issues that are blocking us from making progress.
Custom timestamp class
We use a custom DateTime type and Entity, where the entity is an extension of the default DateTime class. When LDEA tries to execute the convertToDatabaseValue
on the DateTime Type, it fails because the $value
passed to the function is also a Type class, not a Doctrine Entity class and our Type class tries to run a method that is only available on the Entity class.
My question is; is it possible to pass the timestamp through the entity manager's config? For example;
[
'entity_managers' => [
'default' => [
'entities' => [
// Some/Entity/Classname::class,
// Default sales entities
],
//
'timestamp' => new \Our\Custom\Entity\DateTime,
],
],
]
and to then have the LogRevisionsListener pick this up if it's set?
UserResolver user interfaces
In order to get the user's identifier, we need to implement one of four interfaces defined by the package;
Authenticatable is one of Laravel's default Contracts, but it asks me to implement additional method stubs that we will never be using.
UniversallyIdentifiable, Identifiable and Nameable come from the somnambulist/laravel-doctrine-behaviours
package. This package is however outdated, and if my research is correct it is replaced by the somnambulist/domain
package. Domain however is a package that would require us to upgrade to a later version of Laravel even at its earlier versions (We're stuck to ramsey/uuid 3.4 right now). Since we cannot upgrade until Laravel 9 LTS comes out, we're in a bit of a pickle. Is it possible for the config to allow us to either specify what identification method/function to use, OR what interface it needs to check for?
Hi! Sorry to bug you again @dave-redfern.
We noticed that at some point, some types fall off and aren't sent correctly. My coworker noticed that when the following like is added under LogRevisionsListener.php:153
$types[] = $targetTable->getTypeOfColumn($definition['referencedColumnName']);
it's fixed. I don't have a direct example of this happening, but the $types
array has only 2 variables where it should have been 3 on one of our entities, the third entity is null
. This could possibly be the wrong solution, but I think it was worth noting.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.