/** * Initializes the FlattenRecord from the given parameter array. * @param $spec associative array of options. See class-level documentation for details. */ function __construct($spec) { RecordTransformer::__construct($spec); $this->fieldPathes = $spec['fieldPathes']; $this->dataPath = @$spec['dataPath']; $this->errorPath = @$spec['errorPath']; }
/** * Initializes the RecordTransformer from the given parameter array. * @param $spec associative array of options. See class-level documentation for details. */ function __construct($spec) { RecordTransformer::__construct($spec); }
/** * Initializes the DataTransclusionSource from the given parameter array. * @param $spec associative array of options. See class-level documentation for details. */ function __construct($spec) { $this->name = $spec['name']; wfDebugLog('DataTransclusion', "constructing " . get_class($this) . " \"{$this->name}\"\n"); $this->keyFields = self::splitList($spec['keyFields']); $this->optionNames = self::splitList(@$spec['optionNames']); if (isset($spec['fieldInfo'])) { $this->fieldInfo = $spec['fieldInfo']; } else { $this->fieldInfo = null; } if (isset($spec['fieldNames'])) { $this->fieldNames = self::splitList($spec['fieldNames']); } elseif (isset($spec['fieldInfo'])) { $this->fieldNames = array_keys($spec['fieldInfo']); } else { $this->fieldNames = $this->keyFields; if (!empty($this->fieldInfo)) { $this->fieldNames = array_merge($this->fieldNames, array_keys($this->fieldInfo)); } $this->fieldNames = array_unique($this->fieldNames); } if (!empty($spec['cacheDuration'])) { $this->cacheDuration = (int) $spec['cacheDuration']; } else { $this->cacheDuration = null; } if (!empty($spec['transformer'])) { if (is_array($spec['transformer'])) { $this->transformer = RecordTransformer::newRecordTransformer($spec['transformer']); } else { $this->transformer = $spec['transformer']; } } else { $this->transformer = null; } $this->sourceInfo = array(); if (!empty($spec['sourceInfo'])) { foreach ($spec['sourceInfo'] as $k => $v) { $this->sourceInfo[$k] = $v; } } $this->sourceInfo['source-name'] = $this->name; // force this one }