1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
class ProductPage extends Page {

  static $belongs_many_many = array(
    'Orders' => 'Order'
  );
?>

<?php

  static $many_many = array(
    'ProductPages' => 'ProductPage'
  );
function addProduct($productID = 0) {
    $orderComponentSet = new ComponentSet();
    $orderComponentSet->setComponentInfo("many_many", $this, "Order", "Order_ProductPages", "ProductPage");
$orderComponentSet->add($productID);

  }
?>