2009-11-22 06:29:24 +01:00
|
|
|
<?php
|
|
|
|
|
2016-06-15 06:03:16 +02:00
|
|
|
namespace SilverStripe\ORM;
|
|
|
|
|
2016-09-26 07:22:19 +02:00
|
|
|
use BadMethodCallException;
|
2017-05-17 07:40:13 +02:00
|
|
|
use SilverStripe\Core\Injector\Injector;
|
2016-06-15 06:03:16 +02:00
|
|
|
use SilverStripe\ORM\Queries\SQLSelect;
|
|
|
|
use SilverStripe\ORM\Queries\SQLDelete;
|
|
|
|
use SilverStripe\ORM\FieldType\DBComposite;
|
2016-08-19 00:51:35 +02:00
|
|
|
use InvalidArgumentException;
|
|
|
|
use Exception;
|
2015-08-30 07:02:55 +02:00
|
|
|
|
2009-11-22 06:29:24 +01:00
|
|
|
/**
|
2013-05-20 12:18:07 +02:00
|
|
|
* Subclass of {@link DataList} representing a many_many relation.
|
2009-11-22 06:29:24 +01:00
|
|
|
*/
|
2016-11-29 00:31:16 +01:00
|
|
|
class ManyManyList extends RelationList
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string $joinTable
|
|
|
|
*/
|
|
|
|
protected $joinTable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string $localKey
|
|
|
|
*/
|
|
|
|
protected $localKey;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string $foreignKey
|
|
|
|
*/
|
|
|
|
protected $foreignKey;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array $extraFields
|
|
|
|
*/
|
|
|
|
protected $extraFields;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array $_compositeExtraFields
|
|
|
|
*/
|
2018-09-27 16:40:23 +02:00
|
|
|
protected $_compositeExtraFields = [];
|
2016-11-29 00:31:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new ManyManyList object.
|
|
|
|
*
|
|
|
|
* A ManyManyList object represents a list of {@link DataObject} records
|
|
|
|
* that correspond to a many-many relationship.
|
|
|
|
*
|
|
|
|
* 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 array $extraFields A map of field => fieldtype of extra fields on the join table.
|
|
|
|
*
|
|
|
|
* @example new ManyManyList('Group','Group_Members', 'GroupID', 'MemberID');
|
|
|
|
*/
|
2018-09-27 16:40:23 +02:00
|
|
|
public function __construct($dataClass, $joinTable, $localKey, $foreignKey, $extraFields = [])
|
2016-11-29 00:31:16 +01:00
|
|
|
{
|
|
|
|
parent::__construct($dataClass);
|
|
|
|
|
|
|
|
$this->joinTable = $joinTable;
|
|
|
|
$this->localKey = $localKey;
|
|
|
|
$this->foreignKey = $foreignKey;
|
|
|
|
$this->extraFields = $extraFields;
|
|
|
|
|
|
|
|
$this->linkJoinTable();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Setup the join between this dataobject and the necessary mapping table
|
|
|
|
*/
|
|
|
|
protected function linkJoinTable()
|
|
|
|
{
|
|
|
|
// Join to the many-many join table
|
|
|
|
$dataClassIDColumn = DataObject::getSchema()->sqlColumnForField($this->dataClass(), 'ID');
|
|
|
|
$this->dataQuery->innerJoin(
|
|
|
|
$this->joinTable,
|
|
|
|
"\"{$this->joinTable}\".\"{$this->localKey}\" = {$dataClassIDColumn}"
|
|
|
|
);
|
|
|
|
|
|
|
|
// Add the extra fields to the query
|
|
|
|
if ($this->extraFields) {
|
|
|
|
$this->appendExtraFieldsToQuery();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds the many_many_extraFields to the select of the underlying
|
|
|
|
* {@link DataQuery}.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function appendExtraFieldsToQuery()
|
|
|
|
{
|
2018-09-27 16:40:23 +02:00
|
|
|
$finalized = [];
|
2016-11-29 00:31:16 +01:00
|
|
|
|
|
|
|
foreach ($this->extraFields as $field => $spec) {
|
2017-05-17 07:40:13 +02:00
|
|
|
$obj = Injector::inst()->create($spec);
|
2016-11-29 00:31:16 +01:00
|
|
|
|
|
|
|
if ($obj instanceof DBComposite) {
|
2018-09-27 16:40:23 +02:00
|
|
|
$this->_compositeExtraFields[$field] = [];
|
2016-11-29 00:31:16 +01:00
|
|
|
|
|
|
|
// append the composite field names to the select
|
|
|
|
foreach ($obj->compositeDatabaseFields() as $subField => $subSpec) {
|
|
|
|
$col = $field . $subField;
|
|
|
|
$finalized[] = $col;
|
|
|
|
|
|
|
|
// cache
|
|
|
|
$this->_compositeExtraFields[$field][] = $subField;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$finalized[] = $field;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-28 19:23:38 +02:00
|
|
|
$this->dataQuery->addSelectFromTable($this->joinTable, $finalized);
|
2016-11-29 00:31:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a DataObject from the given SQL row.
|
|
|
|
*
|
|
|
|
* @param array $row
|
|
|
|
* @return DataObject
|
|
|
|
*/
|
|
|
|
public function createDataObject($row)
|
|
|
|
{
|
|
|
|
// remove any composed fields
|
2018-09-27 16:40:23 +02:00
|
|
|
$add = [];
|
2016-11-29 00:31:16 +01:00
|
|
|
|
|
|
|
if ($this->_compositeExtraFields) {
|
|
|
|
foreach ($this->_compositeExtraFields as $fieldName => $composed) {
|
|
|
|
// convert joined extra fields into their composite field types.
|
2018-09-27 16:40:23 +02:00
|
|
|
$value = [];
|
2016-11-29 00:31:16 +01:00
|
|
|
|
|
|
|
foreach ($composed as $subField) {
|
|
|
|
if (isset($row[$fieldName . $subField])) {
|
|
|
|
$value[$subField] = $row[$fieldName . $subField];
|
|
|
|
|
|
|
|
// don't duplicate data in the record
|
|
|
|
unset($row[$fieldName . $subField]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-17 07:40:13 +02:00
|
|
|
$obj = Injector::inst()->create($this->extraFields[$fieldName], $fieldName);
|
2016-11-29 00:31:16 +01:00
|
|
|
$obj->setValue($value, null, false);
|
|
|
|
$add[$fieldName] = $obj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$dataObject = parent::createDataObject($row);
|
|
|
|
|
|
|
|
foreach ($add as $fieldName => $obj) {
|
|
|
|
$dataObject->$fieldName = $obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $dataObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a filter expression for when getting the contents of the
|
|
|
|
* relationship for some foreign ID
|
|
|
|
*
|
2018-09-27 16:40:23 +02:00
|
|
|
* @param int|null|string|array $id
|
2016-11-29 00:31:16 +01:00
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function foreignIDFilter($id = null)
|
|
|
|
{
|
|
|
|
if ($id === null) {
|
|
|
|
$id = $this->getForeignID();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Apply relation filter
|
|
|
|
$key = "\"{$this->joinTable}\".\"{$this->foreignKey}\"";
|
|
|
|
if (is_array($id)) {
|
2018-09-27 16:40:23 +02:00
|
|
|
return ["$key IN (" . DB::placeholders($id) . ")" => $id];
|
|
|
|
}
|
|
|
|
if ($id !== null) {
|
|
|
|
return [$key => $id];
|
2016-11-29 00:31:16 +01:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a filter expression for the join table when writing to the join table
|
|
|
|
*
|
|
|
|
* When writing (add, remove, removeByID), we need to filter the join table to just the relevant
|
|
|
|
* entries. However some subclasses of ManyManyList (Member_GroupSet) modify foreignIDFilter to
|
|
|
|
* include additional calculated entries, so we need different filters when reading and when writing
|
|
|
|
*
|
|
|
|
* @param array|int|null $id (optional) An ID or an array of IDs - if not provided, will use the current ids
|
|
|
|
* as per getForeignID
|
|
|
|
* @return array Condition In array(SQL => parameters format)
|
|
|
|
*/
|
|
|
|
protected function foreignIDWriteFilter($id = null)
|
|
|
|
{
|
|
|
|
return $this->foreignIDFilter($id);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an item to this many_many relationship
|
|
|
|
* Does so by adding an entry to the joinTable.
|
|
|
|
*
|
2018-03-14 15:08:41 +01:00
|
|
|
* Can also be used to update an already existing joinTable entry:
|
|
|
|
*
|
|
|
|
* $manyManyList->add($recordID,["ExtraField" => "value"]);
|
|
|
|
*
|
2016-11-29 00:31:16 +01:00
|
|
|
* @throws InvalidArgumentException
|
|
|
|
* @throws Exception
|
|
|
|
*
|
|
|
|
* @param DataObject|int $item
|
|
|
|
* @param array $extraFields A map of additional columns to insert into the joinTable.
|
|
|
|
* Column names should be ANSI quoted.
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
2018-09-27 16:40:23 +02:00
|
|
|
public function add($item, $extraFields = [])
|
2016-11-29 00:31:16 +01:00
|
|
|
{
|
|
|
|
// Ensure nulls or empty strings are correctly treated as empty arrays
|
|
|
|
if (empty($extraFields)) {
|
2018-09-27 16:40:23 +02:00
|
|
|
$extraFields = [];
|
2016-11-29 00:31:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Determine ID of new record
|
|
|
|
$itemID = null;
|
|
|
|
if (is_numeric($item)) {
|
|
|
|
$itemID = $item;
|
|
|
|
} elseif ($item instanceof $this->dataClass) {
|
2018-01-30 06:28:28 +01:00
|
|
|
// Ensure record is saved
|
|
|
|
if (!$item->isInDB()) {
|
|
|
|
$item->write();
|
|
|
|
}
|
2016-11-29 00:31:16 +01:00
|
|
|
$itemID = $item->ID;
|
|
|
|
} else {
|
|
|
|
throw new InvalidArgumentException(
|
|
|
|
"ManyManyList::add() expecting a $this->dataClass object, or ID value"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
if (empty($itemID)) {
|
2018-01-30 06:28:28 +01:00
|
|
|
throw new InvalidArgumentException("ManyManyList::add() couldn't add this record");
|
2016-11-29 00:31:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Validate foreignID
|
|
|
|
$foreignIDs = $this->getForeignID();
|
|
|
|
if (empty($foreignIDs)) {
|
|
|
|
throw new BadMethodCallException("ManyManyList::add() can't be called until a foreign ID is set");
|
|
|
|
}
|
|
|
|
|
|
|
|
// Apply this item to each given foreign ID record
|
|
|
|
if (!is_array($foreignIDs)) {
|
2018-09-27 16:40:23 +02:00
|
|
|
$foreignIDs = [$foreignIDs];
|
2016-11-29 00:31:16 +01:00
|
|
|
}
|
|
|
|
foreach ($foreignIDs as $foreignID) {
|
|
|
|
// Check for existing records for this item
|
|
|
|
if ($foreignFilter = $this->foreignIDWriteFilter($foreignID)) {
|
|
|
|
// With the current query, simply add the foreign and local conditions
|
|
|
|
// The query can be a bit odd, especially if custom relation classes
|
|
|
|
// don't join expected tables (@see Member_GroupSet for example).
|
2018-09-27 16:40:23 +02:00
|
|
|
$query = SQLSelect::create("*", "\"{$this->joinTable}\"");
|
2016-11-29 00:31:16 +01:00
|
|
|
$query->addWhere($foreignFilter);
|
2018-09-27 16:40:23 +02:00
|
|
|
$query->addWhere([
|
2016-11-29 00:31:16 +01:00
|
|
|
"\"{$this->joinTable}\".\"{$this->localKey}\"" => $itemID
|
2018-09-27 16:40:23 +02:00
|
|
|
]);
|
2016-11-29 00:31:16 +01:00
|
|
|
$hasExisting = ($query->count() > 0);
|
|
|
|
} else {
|
|
|
|
$hasExisting = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Blank manipulation
|
2018-09-27 16:40:23 +02:00
|
|
|
$manipulation = [
|
|
|
|
$this->joinTable => [
|
2016-11-29 00:31:16 +01:00
|
|
|
'command' => $hasExisting ? 'update' : 'insert',
|
2018-09-27 16:40:23 +02:00
|
|
|
'fields' => [],
|
|
|
|
],
|
|
|
|
];
|
2016-11-29 00:31:16 +01:00
|
|
|
if ($hasExisting) {
|
2018-09-27 16:40:23 +02:00
|
|
|
$manipulation[$this->joinTable]['where'] = [
|
2016-11-29 00:31:16 +01:00
|
|
|
"\"{$this->joinTable}\".\"{$this->foreignKey}\"" => $foreignID,
|
|
|
|
"\"{$this->joinTable}\".\"{$this->localKey}\"" => $itemID
|
2018-09-27 16:40:23 +02:00
|
|
|
];
|
2016-11-29 00:31:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($extraFields && $this->extraFields) {
|
|
|
|
// Write extra field to manipluation in the same way
|
|
|
|
// that DataObject::prepareManipulationTable writes fields
|
|
|
|
foreach ($this->extraFields as $fieldName => $fieldSpec) {
|
|
|
|
// Skip fields without an assignment
|
|
|
|
if (array_key_exists($fieldName, $extraFields)) {
|
2017-05-17 07:40:13 +02:00
|
|
|
$fieldObject = Injector::inst()->create($fieldSpec, $fieldName);
|
2016-11-29 00:31:16 +01:00
|
|
|
$fieldObject->setValue($extraFields[$fieldName]);
|
|
|
|
$fieldObject->writeToManipulation($manipulation[$this->joinTable]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$manipulation[$this->joinTable]['fields'][$this->localKey] = $itemID;
|
|
|
|
$manipulation[$this->joinTable]['fields'][$this->foreignKey] = $foreignID;
|
|
|
|
|
|
|
|
DB::manipulate($manipulation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove the given item from this list.
|
|
|
|
*
|
|
|
|
* Note that for a ManyManyList, the item is never actually deleted, only
|
|
|
|
* the join table is affected.
|
|
|
|
*
|
|
|
|
* @param DataObject $item
|
|
|
|
*/
|
|
|
|
public function remove($item)
|
|
|
|
{
|
|
|
|
if (!($item instanceof $this->dataClass)) {
|
|
|
|
throw new InvalidArgumentException("ManyManyList::remove() expecting a $this->dataClass object");
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->removeByID($item->ID);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove the given item from this list.
|
|
|
|
*
|
|
|
|
* Note that for a ManyManyList, the item is never actually deleted, only
|
|
|
|
* the join table is affected
|
|
|
|
*
|
|
|
|
* @param int $itemID The item ID
|
|
|
|
*/
|
|
|
|
public function removeByID($itemID)
|
|
|
|
{
|
|
|
|
if (!is_numeric($itemID)) {
|
|
|
|
throw new InvalidArgumentException("ManyManyList::removeById() expecting an ID");
|
|
|
|
}
|
|
|
|
|
2018-09-27 16:40:23 +02:00
|
|
|
$query = SQLDelete::create("\"{$this->joinTable}\"");
|
2016-11-29 00:31:16 +01:00
|
|
|
|
|
|
|
if ($filter = $this->foreignIDWriteFilter($this->getForeignID())) {
|
|
|
|
$query->setWhere($filter);
|
|
|
|
} else {
|
|
|
|
user_error("Can't call ManyManyList::remove() until a foreign ID is set");
|
|
|
|
}
|
|
|
|
|
2018-09-27 16:40:23 +02:00
|
|
|
$query->addWhere([
|
2016-11-29 00:31:16 +01:00
|
|
|
"\"{$this->joinTable}\".\"{$this->localKey}\"" => $itemID
|
2018-09-27 16:40:23 +02:00
|
|
|
]);
|
2016-11-29 00:31:16 +01:00
|
|
|
$query->execute();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove all items from this many-many join. To remove a subset of items,
|
|
|
|
* filter it first.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function removeAll()
|
|
|
|
{
|
|
|
|
|
|
|
|
// Remove the join to the join table to avoid MySQL row locking issues.
|
|
|
|
$query = $this->dataQuery();
|
|
|
|
$foreignFilter = $query->getQueryParam('Foreign.Filter');
|
|
|
|
$query->removeFilterOn($foreignFilter);
|
|
|
|
|
|
|
|
// Select ID column
|
|
|
|
$selectQuery = $query->query();
|
|
|
|
$dataClassIDColumn = DataObject::getSchema()->sqlColumnForField($this->dataClass(), 'ID');
|
|
|
|
$selectQuery->setSelect($dataClassIDColumn);
|
|
|
|
|
|
|
|
$from = $selectQuery->getFrom();
|
|
|
|
unset($from[$this->joinTable]);
|
|
|
|
$selectQuery->setFrom($from);
|
|
|
|
$selectQuery->setOrderBy(); // ORDER BY in subselects breaks MS SQL Server and is not necessary here
|
|
|
|
$selectQuery->setDistinct(false);
|
|
|
|
|
|
|
|
// Use a sub-query as SQLite does not support setting delete targets in
|
|
|
|
// joined queries.
|
2018-09-27 16:40:23 +02:00
|
|
|
$delete = SQLDelete::create();
|
2016-11-29 00:31:16 +01:00
|
|
|
$delete->setFrom("\"{$this->joinTable}\"");
|
|
|
|
$delete->addWhere($this->foreignIDFilter());
|
|
|
|
$subSelect = $selectQuery->sql($parameters);
|
2018-09-27 16:40:23 +02:00
|
|
|
$delete->addWhere([
|
2016-11-29 00:31:16 +01:00
|
|
|
"\"{$this->joinTable}\".\"{$this->localKey}\" IN ($subSelect)" => $parameters
|
2018-09-27 16:40:23 +02:00
|
|
|
]);
|
2016-11-29 00:31:16 +01:00
|
|
|
$delete->execute();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Find the extra field data for a single row of the relationship join
|
|
|
|
* table, given the known child ID.
|
|
|
|
*
|
|
|
|
* @param string $componentName The name of the component
|
|
|
|
* @param int $itemID The ID of the child for the relationship
|
|
|
|
*
|
|
|
|
* @return array Map of fieldName => fieldValue
|
|
|
|
*/
|
|
|
|
public function getExtraData($componentName, $itemID)
|
|
|
|
{
|
2018-09-27 16:40:23 +02:00
|
|
|
$result = [];
|
2016-11-29 00:31:16 +01:00
|
|
|
|
|
|
|
// Skip if no extrafields or unsaved record
|
|
|
|
if (empty($this->extraFields) || empty($itemID)) {
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!is_numeric($itemID)) {
|
|
|
|
throw new InvalidArgumentException('ManyManyList::getExtraData() passed a non-numeric child ID');
|
|
|
|
}
|
|
|
|
|
2018-09-27 16:40:23 +02:00
|
|
|
$cleanExtraFields = [];
|
2016-11-29 00:31:16 +01:00
|
|
|
foreach ($this->extraFields as $fieldName => $dbFieldSpec) {
|
|
|
|
$cleanExtraFields[] = "\"{$fieldName}\"";
|
|
|
|
}
|
2018-09-27 16:40:23 +02:00
|
|
|
$query = SQLSelect::create($cleanExtraFields, "\"{$this->joinTable}\"");
|
2016-11-29 00:31:16 +01:00
|
|
|
$filter = $this->foreignIDWriteFilter($this->getForeignID());
|
|
|
|
if ($filter) {
|
|
|
|
$query->setWhere($filter);
|
|
|
|
} else {
|
|
|
|
throw new BadMethodCallException("Can't call ManyManyList::getExtraData() until a foreign ID is set");
|
|
|
|
}
|
2018-09-27 16:40:23 +02:00
|
|
|
$query->addWhere([
|
2016-11-29 00:31:16 +01:00
|
|
|
"\"{$this->joinTable}\".\"{$this->localKey}\"" => $itemID
|
2018-09-27 16:40:23 +02:00
|
|
|
]);
|
2016-11-29 00:31:16 +01:00
|
|
|
$queryResult = $query->execute()->current();
|
|
|
|
if ($queryResult) {
|
|
|
|
foreach ($queryResult as $fieldName => $value) {
|
|
|
|
$result[$fieldName] = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the join table used for the relationship.
|
|
|
|
*
|
|
|
|
* @return string the name of the table
|
|
|
|
*/
|
|
|
|
public function getJoinTable()
|
|
|
|
{
|
|
|
|
return $this->joinTable;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the key used to store the ID of the local/parent object.
|
|
|
|
*
|
|
|
|
* @return string the field name
|
|
|
|
*/
|
|
|
|
public function getLocalKey()
|
|
|
|
{
|
|
|
|
return $this->localKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the key used to store the ID of the foreign/child object.
|
|
|
|
*
|
|
|
|
* @return string the field name
|
|
|
|
*/
|
|
|
|
public function getForeignKey()
|
|
|
|
{
|
|
|
|
return $this->foreignKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the extra fields included in the relationship.
|
|
|
|
*
|
|
|
|
* @return array a map of field names to types
|
|
|
|
*/
|
|
|
|
public function getExtraFields()
|
|
|
|
{
|
|
|
|
return $this->extraFields;
|
|
|
|
}
|
2009-11-22 06:29:24 +01:00
|
|
|
}
|