-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No ->save() function generated by propel build? #67
Comments
bump |
In Propel3 active-record methods are optional. Set |
What if I don't activate it? What is the difference? And if I don't enable it, how do I persist objects to the database. |
In the data mapper pattern, the persistance logic is not contained into the entity, so you should use the session objectd to do it: // create the $configuration manually
$configuration = new Configuration(‘./path/to/propel.yml’);
$session = $configuration->createSession();
$car1 = new Car(‘Ford Mustang’);
$session->persist($car);
$car2 = new Car(‘Ferrari Testarossa’);
$session->persist($car);
$session->commit(); //Save the objects to the database, following the unit-of-work pattern |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm relatively new to Propel. I setup my DB with
propel init
, and didpropel build
, which generated the models. However, when I tried to use the->save()
function, my IDE reports that the method does not exist. Does anyone know why this is so?I'm using PHPStorm 2017.1.4
Also, my IDE also reports that another definition with the same name exists in the file, and commenting out the
use myNameSpace\SubNameSpace\ModelName
seemed to help.The text was updated successfully, but these errors were encountered: