private function perform($startSort, $pid)
{
$this->loadLanguageFiles();
// Loop over all attributes now.
foreach ($this->metaModel->getAttributes() as $attribute) {
if (!$this->accepts($attribute)) {
continue;
}
$attrId = $attribute->get('id');
if ($this->knowsAttribute($attribute) || !$this->input->hasValue('attribute_' . $attrId)) {
continue;
}
$data = array_replace_recursive($this->createEmptyDataFor($attribute), array('pid' => $pid, 'sorting' => $startSort, 'tstamp' => time(), 'attr_id' => $attrId));
$startSort += 128;
$query = $this->database->prepare('INSERT INTO ' . static::$table . ' %s')->set($data);
$query->execute();
$data['id'] = $query->insertId;
$this->knownAttributes[$attrId] = $data;
}
}