title: CakePHP How to save manytomany
body: <p>I have the following view for adding Properties to a product.    </p>
  
  <pre><code>echo $this-&gt;Form-&gt;create('Product', array('role' =&gt; 'form'));
  echo $this-&gt;Form-&gt;input('ProductProperty.Property', array(
      'multiple' =&gt; 'multiple',
      'type' =&gt; 'select',
  ));
  echo $this-&gt;Form-&gt;input('id', array('type' =&gt; 'hidden'));
  echo $this-&gt;Form-&gt;end('Submit);
  </code></pre>
  
  <p>Which action on the Product Model do I have to call that Properties as well as ProductProperties are created? The ProductProperty is a mapping Model for the Product and the Property table.</p>
  
  <pre><code>array(
      'ProductProperty' =&gt; array(
          'Property' =&gt; array(
              (int) 0 =&gt; '4',
              (int) 1 =&gt; '5'
          )
      ),
      'Product' =&gt; array(
          'id' =&gt; '1'
      )
  )
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Error: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: 
  a foreign key constraint fails (`product_properties`, CONSTRAINT `product_properties_id_fk2` FOREIGN KEY (`property_id`) REFERENCES `properties` (`id`))
  
  SQL Query: INSERT INTO `product_properties` (`product_id`) VALUES (1)
  </code></pre>