Thanks a lot for recent help. It works really well, but now I am having some problems with this code.
//Save course record to DB
$record_course = new course();
$record_course->setName($courseInfo['name']);
$record_course->setUrl($courseInfo['url']);
$record_course->setAcronym($courseInfo['acronym']);
$record_course->setCourseTypeId($record_courseType->getId());
$record_course->setStartDate($courseInfo['startDate']);
$record_course->setCollegeId($record_college->getId());
$record_course->setPlanUrl($courseInfo['planUrl']);
$record_course->replace();
As you can see, I try to update a record but now we have some foreign keys. In this case is CourseTypeId and CollegeId. When i try to replace this record i get next message:
"SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (grabmark.course, CONSTRAINT course_course_type_id_course_type_id FOREIGN KEY (course_type_id) REFERENCES course_type (id))"
Anyone can help me please? Sorry, but i am initiate now in symfony and it's my first contact with an MVC Framework. Thanks a lot, Alexandre Sousa