Check out the documentation at https://thecodingmachine.github.io/tdbm/.
You can run the tests with different backend thanks to the following scripts:
The Database Machine is a PHP ORM that requires no configuration. The object model is deduced from the database model.
Home Page: https://thecodingmachine.github.io/tdbm/
Check out the documentation at https://thecodingmachine.github.io/tdbm/.
You can run the tests with different backend thanks to the following scripts:
When I generate DAOs, in files like Abstract (no editable), DAO can generate function findOneBy .. like this for example in AbstractDocumentTypeDao :
/**
* Get a DocumentType filtered by whiteLabel, documentModels.
*
* @param WhiteLabel $whiteLabel
* @param DocumentModel $documentModels
* @param string[] $additionalTablesFetch A list of additional tables to fetch (for performance improvement)
* @return DocumentType|null
*/
public function findOneByWhiteLabelAndDocumentModels(WhiteLabel $whiteLabel, ?DocumentModel $documentModels = null, array $additionalTablesFetch = array()) : ?DocumentType
{
$filter = [
'white_label_id' => $whiteLabel->getId(),
'document_models_id' => ($documentModels !== null) ? $documentModels->getId() : null,
];
return $this->findOne($filter, [], $additionalTablesFetch);
}
In my schema DB, white_label_id and document_models_id are NOT NULL
So, second params should not be an optional parameter.
Can it be corrected? Thank you
Process: I've added a column "4d_external_id" using a migration. Then I've generated the DAO/Beans using tdbm:generate command. No error from the command.
But the new generate Abstract file has now a syntax error because of a new getter/setter
set4dExternalId(?int $4d_external_data)
: Unexpected integer.
Potential fix: when generating the files, if the column start with an integer, add an underscore (_) before the name of the variable.
Hello,
I'm trying to use findFromRawSql with a custom query and instead of having SELECT table.* FROM
as the doc:
You should not put an alias on the main table name, and select its columns using `*`. So the SELECT part of you $sql should look like:
"SELECT table.* FROM ..."
I'm using SELECT DISTINCT table.* FROM
but I got an error:
Exception:
Invalid array. Could not find expression type: array (
'delim' => ',',
)
LINE: 23
FUNCTION: SQLParser\Node\NodeFactory::toObject()
FILE: /var/www/html/vendor/mouf/magic-query/src/SQLParser/Node/NodeFactory.php
Is the usage of DISTINCT not possible ? If so, maybe change the doc from should look like
to must look like
?
Thanks
TDBM assumes that all foreign keys point towards a primary key.
This is not always true.
right now the detection is limited to the "group" of method: regular properties, one-to-many relationships and many-to-many relationships
My model:
Structure of the geo_locations_relations table:
Behaviour:
What I would like: I don't know 🙃 Maybe two functions which specify the column to use for the path (the starting point):
See title 😄
Hello,
I have a table event
with 2 columns:
idevent
the primary keynid
an int columnAnd my second table preference
with 2 columns:
idpreference
the primary keyevent_nid
an indexed column with a relationship on event.nid
When I try to save a new PreferenceBean, I must pass an EventBean, but on save(), it's event.idevent
which is took instead of event.nid
according to the relationship.
Thanks
When cloning a table with a UUID primary key, the cloned object does not have a new UUID generated. Instead, the primary key is empty.
We should expect a new UUID to be generated instead.
Let's say I have a table with 2 foreign keys. Both keys are part of the same unique index.
TDBM generates the following function :
findOneByAandB(A $a, ?B $b = null){
$filter = [
'a_id' => $a->getId(),
'b_id' => ($b !== null) ? $b->getId() : null,
];
return $this->findOne($filter, [], $additionalTablesFetch);
}
Question 1 : why is the second argument nullable and optional ?
Question 2 : If the first FK is nullable, I should be able to query the same function by passing null for the nullable column :
$result = $dao->findOneByAandB(null, $b);
...but this is not possible given the actual signature first input cannot be null, and even if we change the signature, this will still not work because the filter is not asking for explicit null value. It will, in fact query b_id = [ID_OF_B]
only.
Hello !
I was told that injecting DaoFactory is somehow deprecated because it causes performance issues (when injecting, all DAOs are loaded or someting) !
I don't know it it's related to Mouf or TDBM, but its a shame ! DaoFactory is really convenient and it would be really nice to keep using it, since its generated !
Thanks
Hi !
I'm using TDBM on a project, is it possible to get a result as an associative array ( see here for the same thing in doctrine ) instead of a full instance of an object ?
We need to wrap save into a transaction to be sure to not save a bean partially (for instance saving the main bean but failing to save the many to many relationships)
Hello !
I would like to know if it's possible to throw an error to indicates that a key has not been found in the parameter list ?
For example:
return $this->find('foo = :foo AND bar = :bar AND baz = :baz', [
'foo' => 42,
'baar' => 'Wrong key',
'baz' => null
]);
In my code, I expect a key bar
that is not provided, and would like to throw an error because my query will be wrongly executed if i mistype a parameter key.
I understand that when a value is null
, it should work properly by removing the condition internally. But I expect that for not found key, it should not behave like that.
Is there any way to avoid the query to be executed if a key is missing ?
Thank you !
On a many-to-one relationship, if there are two nested foreach, the first foreach does not complete successfully.
Example :
$activities = $entity->getActivities();
foreach($activities as $activity){
foreach($activities as $activity2){
// BOOM ! Nested iteration issue
}
}
Hello, I just trying to open the Documentation Page, and page loaded like screenshoot below
I think there is something wrong during the build process.
I've recently come across this library and I'd like to make use of it in my project that uses no frameworks, but unfortunately I seem to have hit a roadblock right off the bat.
I'm trying to follow the following installation guide: https://thecodingmachine.github.io/tdbm/doc/manual_install.html
The first thing that was immediately obvious upon opening the doc compared to the other ones is that it does not mention what package to even install from Composer, I had to find this repository and get the package name from the Composer JSON.
Then follows the real kicker, taking the code from that page, my IDE immediately complained that I passed no arguments to new TheCodingMachine\TDBM\Utils\DefaultNamingStrategy()
. Rightfully so, as running the code without it also throws.
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function TheCodingMachine\TDBM\Utils\DefaultNamingStrategy::__construct(), 0 passed in file.php on line 22 and exactly 2 expected in .../vendor/thecodingmachine/tdbm/src/Utils/DefaultNamingStrategy.php:40
I found this confusing and I'm not really sure how to move forward.
If a table is inherited, the jsonSerialize
of the inherited table will call the parent jsonSerialize
AND will also set the columns of the parent table.
In many to one relationships, in beans, the @return statement of the generated method in the abstract bean lacks a "use" statement.
SQL Schema:
CREATE TABLE `object` (
`id` INT NOT NULL,
PRIMARY KEY (`id`));
CREATE TABLE `media` (
`id` INT NOT NULL,
`object_id` INT NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY fk_object(object_id)
REFERENCES object(id));
TDBM generate a getter on the Object
Entity named getMediasByObjectId(): AlterableResultIterator
.
Here, because of the unique index on object_id, the relation is a OneToOne and not a OneToMany, so the generated method should have been getMediaByObjectId(): ?Media
(notice the return type is nullable as TDBM can't ensure the existence)
Present : When the jsonSerialize() method is called, is the $stopReccursion equals true, the referenced entities are not serialized in the returned data and no key is included to replace the ignore object.
What I would like : In the same situation, include the value of the foreign key column.
Ex:
When $stopReccursion === false :
{id: 123, label: "TheCodingMachine", type: {id: 1, label: "Company"}}
When $stopReccursion === true :
{id: 123, label: "TheCodingMachine", typeId: 1}
We could generate custom iterators per table that can be customized by users to offer "on the fly filtering".
It could work like this:
$users = $userDao->findAll()->filterActiveUsers()->filterAdults();
Behind the scene, the findAll()
method returns a UserResultIterator
(instead of a simple ResultIterator
). The UserResultIterator
has been coded by the developer (I'm not sure exactly how yet...)
Maybe something like:
class UserResultIterator extends ResultIterator {
public function filterActiveUsers() : ResultIterator {
return $this->andSqlFilter('active = 1');
}
}
You think this is a good idea?
It looks like the keys generated by FindObjectsQueryFactory in the compute() method (for example) contain spaces in the filterString and therefore the cache $key, which Doctrine's MemcachedCache class does not allow:
https://github.com/doctrine/cache/blob/master/lib/Doctrine/Common/Cache/MemcachedCache.php
See the validateCacheId() method.
Sidenote: I am triggering this problem by performing a $this->find() method call within a Dao object, such as:
return $this->find("user_agent IN (:user_agent)", [ 'user_agent' => implode(',', $user_agent) ]);
In this example, this part of the query ends up in the filterString ("user_agent IN (:user_agent)") and that is where the spaces are.
When tested with ArrayCache or ApcuCache it works fine.
Context :
Table A |
---|
id : pk |
label |
Table B |
---|
id : pk |
name |
a_id |
b.a_id
points to a.id
*SQL : *
CREATE TABLE `a` (
`id` int(11) NOT NULL,
`label` varchar(10) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Contenu de la table `a`
--
INSERT INTO `a` (`id`, `label`) VALUES
(1, 'foo');
-- --------------------------------------------------------
--
-- Structure de la table `b`
--
CREATE TABLE `b` (
`id` int(11) NOT NULL,
`name` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`a_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Contenu de la table `b`
--
INSERT INTO `b` (`id`, `name`, `a_id`) VALUES
(1, 'bar', 1);
--
-- Index pour les tables exportées
--
--
-- Index pour la table `a`
--
ALTER TABLE `a`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `b`
--
ALTER TABLE `b`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `uniquetest` (`name`,`a_id`),
ADD KEY `a_id` (`a_id`);
--
-- AUTO_INCREMENT pour les tables exportées
--
--
-- AUTO_INCREMENT pour la table `a`
--
ALTER TABLE `a`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT pour la table `b`
--
ALTER TABLE `b`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER TABLE `b`
ADD CONSTRAINT `b_ibfk_1` FOREIGN KEY (`a_id`) REFERENCES `a` (`id`);
See in script, index uniquetest
has order name, then a_id.
Generate DAOs, then call :
$b = $bDao->findOneByNameAndA("bar", $a);
==> returns a B instance
Now hold tight !! Inverse index order :
ALTER TABLE b DROP INDEX uniquetest
ALTER TABLE `tdbmtest`.`b` ADD UNIQUE `uniquetest` (`a_id`, `name`);
Regenerate DAOs, then call :
$b = $bDao->findOneByAAndName($a, "bar");
==> returns wait for it.... NULL
:'(
See code below:
public function findSomething(PurchasingGroup $purchasingGroup)
{
if ($purchasingGroup->getIdcompany() === null) {
return [];
}
return $this->find(
'companies.parent_company_id = :idparent AND companies.status = :status',
[
'idparent' => $purchasingGroup->getIdcompany(),
'status' => 'on'
]
);
}
The return [];
part is problematic because it makes the return type "array|ResultIterator".
We should have a way to return an empty result iterator.
Ideally:
return ResultIterator::getEmptyResultIterator();
When using a primary key with multiple columns, the getById method is not generated (that's ok), but the findOneByXXXAndYYY method is not generated.
It would be better to generate it.
Hello,
Is it possible to improve error message when DuplicateRowException occurs ?
Currently we have something like "More than 1 row have been returned, but we should have received at most one", but we don't have any hint about what field and value.
Thank you :)
We need to add proper documentation for #171
Hi,
I am looking for a way to update all of my lines in one specific table (switch a boolean on each line). How can I do that without using a loop in PHP which will result, if I am not mistaken, in one SQL request for each line ?
I'd like to have a way to execute a raw SQL request or any other way of updating all of my items at once. Is this possible ? I can't find anything about this in the documentation.
Thanks
When you have an unique index between a column of type datetime and others columns, it creates an auto-generated function, which expects a DateTimeImmutable parameter
Issue : this parameter is not formatted in the filter array => it crashes
Fix : Either format the date with a 'default format' (which one ?), or change the parameter type expected
An error occurs when sorting on a column from a children table and fetching beans from the parent table.
For instance (in the test dataset): performing a "find" on the "PersonDao" while sorting on "users.email"
Hello,
When I try to generate the DAOs with a table without a primary key, the generation stops with an unclear message:
Error: Call to a member function getUnquotedColumns() on null in /var/www/html/vendor/thecodingmachine/tdbm/src/Utils/TDBMDaoGenerator.php on line 210
Thanks
We could filter a query by result iterators.
Since the result iterator contains a link to the query factory, we could use the query factory to write the part of the subquery needed.
for instance:
$results = $userDao->find("status = 'deleted'")
could translate to:
SELECT id FROM users WHERE status = 'deleted'
(basically, it is the same thing as the full query but only with ids as columns)
We can then put this query into another query:
$countriesWithDeletedUsers = $coutryDao->find($results);
which will generate:
SELECT * FROM MAGICQUERY(countries) WHERE countries.id IN (SELECT id FROM users WHERE status = 'deleted')
It is not the most efficient way to write the query, but it shall do the trick.
Alternative syntax:
$countriesWithDeletedUsers = $coutryDao->find('countries.id IN : countries',
['countries' => $results]);
TDBM does nothing with views.
We could consider building DAOs and immutable beans when a view is encountered.
If you are interested with this feature, plus send a +:1+ on this issue.
Hi,
When I remove a table in my database, and I generate my repositories and beans, the abstract files of my removed table are still there.
Thanks.
When I create a table with blob
type, I cannot call getter on this property because expected return type is string
whereas real return type is resource
.
Moreover, JSON serialization fails (I guess it's because it's quite difficult to json_encode a blob :))
Thus, it fails.
MySQL allows for 2 indexes to be declared on exactly the same columns.
We should check for similar indexes and do not generate the same method twice.
How can I filter result using Related table columns?
Suppose We have 2 users(Admin1 and Admin2). A user can create/update a group.
When a user creates a group, we store user id as a foreign key in the groups table by name created_by.
Now I need to Fetch all groups created by admin1 using the user name column.
I dig deep in TDBM package code but I am not being able to find any Built-in functionality that can support this use-case.
Please let me know If I miss this functionality or I need to write a raw query for this use-case.
Following merge of #43, Oracle unit test fail to build the schema.
Error message:
There were 147 errors:
1) TheCodingMachine\TDBM\Commands\GenerateCommandTest
Doctrine\DBAL\Driver\OCI8\OCI8Exception: ORA-00942: table or view does not exist in /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php:33
Stack trace:
#0 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php(350): Doctrine\DBAL\Driver\OCI8\OCI8Exception::fromErrorInfo(Array)
#1 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php(140): Doctrine\DBAL\Driver\OCI8\OCI8Statement->execute()
#2 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1094): Doctrine\DBAL\Driver\OCI8\OCI8Connection->exec('ALTER TABLE "re...')
#3 /app/tests/TDBMAbstractServiceTest.php(341): Doctrine\DBAL\Connection->exec('ALTER TABLE "re...')
#4 /app/tests/TDBMAbstractServiceTest.php(108): TheCodingMachine\TDBM\TDBMAbstractServiceTest::initSchema(Object(Doctrine\DBAL\Connection))
#5 /app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(668): TheCodingMachine\TDBM\TDBMAbstractServiceTest::setUpBeforeClass()
#6 /app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#7 /app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(517): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#8 /app/vendor/phpunit/phpunit/src/TextUI/Command.php(186): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array, true)
#9 /app/vendor/phpunit/phpunit/src/TextUI/Command.php(116): PHPUnit_TextUI_Command->run(Array, true)
#10 /app/vendor/phpunit/phpunit/phpunit(52): PHPUnit_TextUI_Command::main()
#11 {main}
Next Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'ALTER TABLE "ref_no_prim_key" ADD CONSTRAINT FK_616AF5B76A5A3777 FOREIGN KEY ("from") REFERENCES ref_no_prim_key ("to")':
ORA-00942: table or view does not exist in /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractOracleDriver.php:58
Stack trace:
#0 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(176): Doctrine\DBAL\Driver\AbstractOracleDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\OCI8\OCI8Exception))
#1 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(150): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\OCI8\Driver), Object(Doctrine\DBAL\Driver\OCI8\OCI8Exception), 'An exception oc...')
#2 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1096): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\OCI8\Driver), Object(Doctrine\DBAL\Driver\OCI8\OCI8Exception), 'ALTER TABLE "re...')
#3 /app/tests/TDBMAbstractServiceTest.php(341): Doctrine\DBAL\Connection->exec('ALTER TABLE "re...')
#4 /app/tests/TDBMAbstractServiceTest.php(108): TheCodingMachine\TDBM\TDBMAbstractServiceTest::initSchema(Object(Doctrine\DBAL\Connection))
#5 /app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(668): TheCodingMachine\TDBM\TDBMAbstractServiceTest::setUpBeforeClass()
#6 /app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#7 /app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(517): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#8 /app/vendor/phpunit/phpunit/src/TextUI/Command.php(186): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array, true)
#9 /app/vendor/phpunit/phpunit/src/TextUI/Command.php(116): PHPUnit_TextUI_Command->run(Array, true)
#10 /app/vendor/phpunit/phpunit/phpunit(52): PHPUnit_TextUI_Command::main()
#11 {main}
Caused by
Doctrine\DBAL\Driver\OCI8\OCI8Exception: ORA-00942: table or view does not exist in /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php:33
Stack trace:
#0 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php(350): Doctrine\DBAL\Driver\OCI8\OCI8Exception::fromErrorInfo(Array)
#1 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php(140): Doctrine\DBAL\Driver\OCI8\OCI8Statement->execute()
#2 /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1094): Doctrine\DBAL\Driver\OCI8\OCI8Connection->exec('ALTER TABLE "re...')
#3 /app/tests/TDBMAbstractServiceTest.php(341): Doctrine\DBAL\Connection->exec('ALTER TABLE "re...')
#4 /app/tests/TDBMAbstractServiceTest.php(108): TheCodingMachine\TDBM\TDBMAbstractServiceTest::initSchema(Object(Doctrine\DBAL\Connection))
#5 /app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(668): TheCodingMachine\TDBM\TDBMAbstractServiceTest::setUpBeforeClass()
#6 /app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(722): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#7 /app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(517): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#8 /app/vendor/phpunit/phpunit/src/TextUI/Command.php(186): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array, true)
#9 /app/vendor/phpunit/phpunit/src/TextUI/Command.php(116): PHPUnit_TextUI_Command->run(Array, true)
#10 /app/vendor/phpunit/phpunit/phpunit(52): PHPUnit_TextUI_Command::main()
#11 {main}
Hello,
I have this code that is not working:
/**
* @param int $idcompany_relationship
* @param string $type
* @param string|null $value
* @return \Wabel\Entities\CompanyRelationshipHistory|null
*/
public function getLastHistory($idcompany_relationship, $type, $value)
{
return $this->find("idcompany_relationship = :idcompany_relationship AND field = :field AND value_to :value_to", [
"idcompany_relationship" => $idcompany_relationship,
"field" => $type,
"value_to" => $value,
], "history_date DESC")->first();
}
But this one works well:
/**
* @param int $idcompany_relationship
* @param string $type
* @param string|null $value
* @return \Wabel\Entities\CompanyRelationshipHistory|null
*/
public function getLastHistory($idcompany_relationship, $type, $value)
{
$lastId = $this->tdbmService->getConnection()->executeQuery('SELECT idrelationship_history FROM company_relationship_history WHERE idcompany_relationship = '.$idcompany_relationship.' AND field = "'.$type.'" ORDER BY history_date DESC LIMIT 1')->fetch();
if (!$lastId) {
return null;
}
return $this->findOne([
'idrelationship_history' => $lastId
]);
}
I'm thinking that field
is a reserved word in MySQL, and the escape is not done properly.
Anything you can do ?
Thank you :)
We currently use RedBeanPHP, but are looking into alternatives. Are 'beans' in your system the same?
Database : I have a table agreement and a table agreement_status
In my table agreement, i have a column status_id, referencing to the agreement_status with a default value of 1
In the agreement_status table, the line with id = 1 exists
Issue : in the constructor of the AbstractAgreement, the status is not automatically set, we have to provide it as a parameter. Indeed, the status must be an instance of AgreementStatus, and not simply a value, like 1
So right now, the default value is ignored
Solution : if the foreign key has a default value, the constructor should automatically find the object asscoiated to the default value, and set it in the constructor
Hello,
I have a table participation
with 3 columns:
My primary key is event_code AND idcompany.
When I try to delete a participation I have this error:
Doctrine\DBAL\Exception\InvalidArgumentException: Empty criteria was used, expected non-empty criteria
/var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Exception/InvalidArgumentException.php:38
/var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:675
/var/www/html/vendor/thecodingmachine/tdbm/src/TDBMService.php:287
Is it a problem on my side ?
Thanks
templates annotations for iterators methods (first, map, add, etc)
we are using this package on php 7.4.
I noticed that the server returns 500 error with Notice: Trying to access array offset on value of type bool
when I try to delete beans or return ResultIterator to jsonresponse.
This error doesn't always happen, I think this error happens when the bean has many_to_many relationships with other tables.
In TDBM 5.1, finding the bean class from the table name requires accessing the DB model (because we need access to the @bean annotation)
Therefore, we need to cache the table => beanClassName relationship.
See https://github.com/thecodingmachine/tdbm/blob/master/src/TDBMService.php#L546-L557
Hello,
Maybe it's fixed on new version, but when generating DAOs, TDBM causes git to detect a diff even if table the structure didn't change, which makes unwanted changes hard to track !
Thx !
We can tremendously improve DaoFactory performance by lazy loading Daos.
To do that, it is easy to inject the container in the DaoFactory (rather than the dao instances), and to fetch the daos based on their names.
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.