title: CakePHP: Adding default faculty/department values while adding a new University
body: <p>New programmer with with CakePHP, I have 3 controllers: Universities, Faculties, Departments.</p>
  
  <p>My tables are: 
  universities (id, name, country_id),
  faculties(id, name, university_id),
  departments (id, name, faculty_id).</p>
  
  <p>When I add a new University, I need to create automatically a default value ('n/a') as a Faculty for this University, and for this created Faculty a default value ('n/a') as Department.
  in our system, we need the university having at least one faculty and one faculty.department. So if the new university id = 10, then after saving, I need to create a new faculty (let's say faculties.id = 25) with university_i=10. and a new department with faculty_id = 25.</p>
  
  <p>This is my code UniversitiesController add function</p>
  
  <pre><code>$university = $this-&gt;Universities-&gt;newEntity();
  
  if ($this-&gt;request-&gt;is('post')) {
     $university = $this-&gt;Universities-&gt;patchEntity($university, $this-&gt;request-&gt;data);
     if ($this-&gt;Universities-&gt;save($university)) {
         $this-&gt;Flash-&gt;success(__('The university has been saved.'));
         return $this-&gt;redirect(['action' =&gt; 'index']);
     } else {
         $this-&gt;Flash-&gt;error(__('The university could not be saved. Please, try again.'));
     }
  }
  </code></pre>
  
  <p>Any help please?</p>