// Create a new object $person = new Person(); // Set some values $person->setName('John Doe'); $person->setAge(30); // Save the object $entityManager->persist($person); $entityManager->flush();
// Create a new object $person = new Person(); // Set some values $person->name = 'John Doe'; $person->age = 30; // Save the object $person->save();
// Create a new object $person = new Person(); // Set some values $person->setName('John Doe'); $person->setAge(30); // Save the object $person->save();You would need to have the Propel library installed and configured to use this code. In summary, there are several PHP libraries that can help you save objects easily. Depending on the library you choose, the syntax and configuration may differ slightly.