thyyppa / fluent-fm Goto Github PK
View Code? Open in Web Editor NEWA PHP package for FileMaker Server's Data API using a fluent query builder style interface.
License: MIT License
A PHP package for FileMaker Server's Data API using a fluent query builder style interface.
License: MIT License
This is a great package I have used in several projects. Thank you for making it available. I have an issue in one of my projects related to search criteria across multiple uses. As far as I can tell in the documentation, there is no way to clear existing search criteria in a persistent connection. I am using a singleton model where I instantiate the connection in the constructor and use the same instance across several queries and updates throughout my job. The problem is when I try to search for the same foreign key in two different fields. In this use case, I have actual parent with child records. The data model has two foreign key fields, one for the father and one for the mother. I do not always have a 'gender' to use as a qualifier for the search. So I am using a standard try catch to first check for child records where the parent is in the mother fk field. Then do the same for the father fk field position. What I see in the logs is that the search criteria value is persisted from the mother search when the father search is executed. So I never get a correct return from my attempts to search for the father because it is searching for records that have a parent pk in both the father fk and mother fk fields. This breaks down in many other places later on, but in all cases it is related to search criteria persisting after execution. If I am somehow using this incorrectly, please let me know.
As this prevents anyone from removing data from a column or setting a column NULL.
Doing on delete with anything but the id as conditions will throw a 400 Bad Request when the conditions don't match any record.
This is due to $this->find($layout)->get() L:265
returning nothing.
https://github.com/thyyppa/fluent-fm/blob/master/src/Connection/FluentFMRepository.php#L245
public function delete(string $layout, int $recordId = null): FluentFM
{
$this->callback = function () use ($layout, $recordId) {
$recordIds = $recordId ? [$recordId] : array_keys($this->find($layout)->get());
foreach ($recordIds as $id) {
// ...
}
};
}
And $recordIds
ending up as an empty array.
Then attempting to DELETE /layout/
without specifying an id which triggers a legitimate 400 from Filemaker.
I'll submit a PR.
The auto_id field of the FluentFMRepository should be public or have a setter method so it can be set to false
In my use case the responsibility of setting the id lies with the database, so we do not want to set the id when creating a new dataset.
Is it possible to run a script on its own (outside of a find) and have the script results returned?
Whenever the "where" function is used, it returns an error indicating that it does not find the field. Could you tell me how to fix it please?
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.