Simple question that has been driving me nuts. I am working on a project in Flashbuilder, have generated a php service. I have had to make some changes to the database. How do I get flashbuilder to recognize these changes. I have made changes to the php methods and I know how to get them to recognize that. It is just the added fields in my database, how do I get them into the php and then into the corresponding actionscript object.
Thanks
Every time you change the database, you have to 'refresh' the model (your PHP page). In Flex it is called a value object (VO), which is just a PHP class that represents and stores the data from the database.
When the database table changes, the VO object must also change or the new additions to the database will not accessible.
What is happening is that FlashBuilder is seeing the old version of your VO object because it has not been updated. You can write a VO manually in PHP and import it or use the FlashBuilder wizard to re-create it based on the new database tables without having to code, like you did the first time you created it.
For further information on the topic, see: http://www.flashrealtime.com/flash-builder-4-and-php-data-services/
Are you using Value Objects?
Anyway, try to do this:
1. refresh your services in flash builder (right click -> refresh, or just hit the button)
2. right click on your service in flash builder and determine output type. This simple process will ask you the parameters that the php service needs and it will generate the new object
Related
I'm new to Laravel. Maybe my questions are a little bit silly... Sorry...
The goal: There are some API resources and I need to take some selective data from them (It will be needed to make extra API queries from data which I already got before to get full sets of required values) and fill my DB tables with it (some as one to many, some as many to many).
The problem: What Laravel tools do I need to use to reach this goal? Is it factory, seeder or somewhat else? In addition I don't understand where I have to write the code for getting data from an external API and where (in terminal manually?) I have to initiate my DB tables filling.
Maybe someone could at least advise what to learn in the Laravel official documentation at first or some helpful reference to some article from which I will be clear how this process may be implemented in Laravel. I mean the tools' set and order to use them. Not the finished code implementation of course.
I will be grateful for any help. Thanks. Sorry for my non native English.
Well, there are multiple ways of achieving what you want:
One is to create a command where you are going to write code to fetch this data (using curl or any similar way). And then you manually run the command when you want with whatever arguments you want.
Other one is to use the previous step and schedule it to run in a desired time with desired arguments.
Other possible way is, if the external API can send data to a specific URL when some action occurs in that system, then you can create a normal Route and the API should point to this Route in your Laravel. It will be specific and only work for this API.
Other one is to fetch data based on an event. Let's say that, if a user register, when this is successful, you are going to fetch User info from an external API using their email (let's say you want to get a profile picture from an API and the only way to get the user picture is sending the user's email). You can do so using Events.
There are more ways, but if you don't give too much context, then this is what I can share with you !
I am having trouble with my API written with Laravel. Basically, I modify a value directly in the database used with Laravel, but it seems to get the original value(s) not the one that has been modified.
At first I thought maybe it could be cache related, but we aren't using any cache drivers. Other than the cache drivers, is there some sort of magic caching Laravel is doing behind the scenes? Is this normal behaviour for laravel apps?
Is there something else I need to clear each time I modify a value directly in the database?
If I were to modify this value via the API itself, then I am given the correct modified value.
Thank you!
I'm currently saving an object into a class in Parse which currently works fine.
Up to now this has mostly been flat data or the odd pointer which i'm comfortable with.
However, I've recently created a relation column is linked to a Child class which consists of a String and 2 pointers. This data will be provided at the same time as the main row is created.
In theory:
Post data from form to php to process - before saving the main object, create a new ParseObject for the relation providing the String data and associativeArray pointer id's.
Is this the correct way to do it? I have a strange feeling that i will need to save the main row before adding the relation?
Any help would be appreciated greatly :)
You will need to save the main row before adding the relation, because the relation relies on a reference, which relies on an objectId, which doesn't exist until after the initial save. I'm unfamiliar with PHP, though would recommend you add this relation in the success handler of the save call, if there's an equivalent. If there isn't an equivalent, it may be better to write a cloud code function in js to do this, so you can utilize promises / callbacks, and pass the data you have to that function instead of saving the object on your PHP client.
I'm new to Symfony and Doctrine.
I got a project where I need a method inside a Symfony service to be called with data from the DB whenever a dateTime object saved in that DB table "expires" (reaches a certain (dynamic) age).
As I'm just starting out I do not have any code yet. What I need is a start point to get me looking in the right direction as neither the life cycle callbacks nor the doctrine event listener / dispatcher structure seems to be able to solve this task.
Am I missing something important here or is it maybe just a totally wrong start to my problem which actually can't be solved by doctrine itself?
What came to my mind is a cron-job'ish structure, but that kind of implementation is not as dynamic as required but bound to specific time frames which may be not reactive enough and maybe even immensly decreases the performance in different situations.
If I'm getting your problem right: You want something that executes when a record's datetime expires.
The main problem is that you would have to call PHP based on a DB event which is not straight forward...
One possible solution can be a Symfony command that's executed periodically(using cron) and you select the expired entities and do the required actions.
So as far as I found out doctrine is really not able to do this task in the descriped way. Of course the DB can't react to a part of a record it saved without an external action triggering the lookup.
So what I will propably go with is a shell programm called at.
It actually is something like I (and katon.abel) mentioned. It is able to enter one time crons which are then executed according to the provided time (that I then do not need to save in the DB but just pass it to at).
This way I can easily create the crons via symfony, save the needed data via doctrine and call the callback method via a script triggered by at.
I am building an application using the latest copy of Codeigniter 2.0. My application is dynamic and is kind of like a custom CMS I guess you could say. I have a database table called 'settings' with the following fields:
id
name
value
Basically what I am currently doing is using a helper function to retrieve specific settings from my settings table like the site name or current theme. However I've started thinking that maybe the constant amount of database calls for retrieving settings is a bit too much on the database.
Is there a way of retrieving settings for my application from the database and then appending them to my configuration file? I've noticed Mojomotor does something similar and it is a CI 2.0 application, however I would much rather the simplest and easiest code to do so.
I would preferably like to be able to check every so often if a setting in the database has changed and update the configuration file. The less strain on the database the better.
The best solution lies in the middle. Not zero DB calls; and not one DB call per setting. Do one DB call per page load instead, and get every setting in a recordset / object that the rest of your app can refer to as needed.