/** * Create a new ManyManyList object. * * A ManyManyList object represents a list of DataObject records that correspond to a many-many * relationship. In addition to, * * Generation of the appropriate record set is left up to the caller, using the normal * {@link DataList} methods. Addition arguments are used to support {@@link add()} * and {@link remove()} methods. * * @param string $dataClass The class of the DataObjects that this will list. * @param string $joinTable The name of the table whose entries define the content of this many_many relation. * @param string $localKey The key in the join table that maps to the dataClass' PK. * @param string $foreignKey The key in the join table that maps to joined class' PK. * @param string $extraFields A map of field => fieldtype of extra fields on the join table. * * @example new ManyManyList('Group','Group_Members', 'GroupID', 'MemberID'); */ public function __construct($dataClass, $joinTable, $localKey, $foreignKey, $extraFields = array()) { parent::__construct($dataClass); // No join table required $this->joinTable = null; $this->localKey = null; $this->foreignKey = null; $this->extraFields = null; // $baseClass = ClassInfo::baseDataClass($dataClass); }
/** * Create a new HasManyList object. * Generation of the appropriate record set is left up to the caller, using the normal * {@link DataList} methods. Addition arguments are used to support {@@link add()} * and {@link remove()} methods. * * @param $dataClass The class of the DataObjects that this will list. * @param $relationFilters A map of key => value filters that define which records * in the $dataClass table actually belong to this relationship. */ public function __construct($dataClass, $foreignKey) { parent::__construct($dataClass); $this->foreignKey = $foreignKey; }