*/
protected function _initialize()
{
- $this->tagger = new Content_Tagger();
- $this->tagger->setDbAdapter(Horde_Db::getAdapter());
+ $this->tagger = new Content_Tagger(array('dbAdapter' => Horde_Db::getAdapter()));
}
/**
throw new InvalidArgumentException('List at least one tag to add.');
}
-$tagger = new Content_Tagger();
-$tagger->setDbAdapter(Horde_Db::getAdapter());
+$tagger = new Content_Tagger(array('dbAdapter' => Horde_Db::getAdapter()));
$tagger->tag($opts->user_id, $opts->object_id, $tags);
exit(0);
throw new InvalidArgumentException('List at least one tag to remove.');
}
-$tagger = new Content_Tagger();
-$tagger->setDbAdapter(Horde_Db::getAdapter());
+$tagger = new Content_Tagger(array('dbAdapter' => Horde_Db::getAdapter()));
$tagger->untag($opts->user_id, $opts->object_id, $tags);
exit(0);
if (!empty($params['typeManager'])) {
$this->_typeManager = $params['typeManager'];
}
- }
-
- /**
- * Set the database connection.
- *
- * @param Horde_Db $db The database connection
- */
- public function setDbAdapter($db)
- {
- $this->_db = $db;
- }
- /**
- * Change the name of a database table.
- *
- * @param string $tableType
- * @param string $tableName
- */
- public function setTableName($tableType, $tableName)
- {
- $this->_tables[$tableType] = $tableName;
+ if (!empty($context['tables'])) {
+ $this->_tables = array_merge($this->_tables, $context['tables']);
+ }
}
/**
if (!empty($context['objectManager'])) {
$this->_objectManager = $context['objectManager'];
}
- }
-
- /**
- * Set the database connection for the tagger.
- *
- * @param Horde_Db $db
- */
- public function setDbAdapter($db)
- {
- $this->_db = $db;
- }
- /**
- * Change the name of a database table.
- *
- * @param string $tableType
- * @param string $tableName
- */
- public function setTableName($tableType, $tableName)
- {
- $this->_tables[$tableType] = $tableName;
+ if (!empty($context['tables'])) {
+ $this->_tables = array_merge($this->_tables, $context['tables']);
+ }
}
/**
if (!empty($context['dbAdapter'])) {
$this->_db = $context['dbAdapter'];
}
- }
-
- /**
- * Set the database adapter.
- *
- * @param Horde_Db $db The database connection
- */
- public function setDbAdapter($db)
- {
- $this->_db = $db;
- }
- /**
- * Change the name of a database table.
- *
- * @param string $tableType
- * @param string $tableName
- */
- public function setTableName($tableType, $tableName)
- {
- $this->_tables[$tableType] = $tableName;
+ if (!empty($context['tables'])) {
+ $this->_tables = array_merge($this->_tables, $context['tables']);
+ }
}
/**
if (!empty($context['dbAdapter'])) {
$this->_db = $context['dbAdapter'];
}
- }
-
- /**
- * Set the database connection.
- *
- * @param Horde_Db $db The database connection
- */
- public function setDbAdapter($db)
- {
- $this->_db = $db;
- }
- /**
- * Change the name of a database table.
- *
- * @param string $tableType
- * @param string $tableName
- */
- public function setTableName($tableType, $tableName)
- {
- $this->_tables[$tableType] = $tableName;
+ if (!empty($context['tables'])) {
+ $this->_tables = array_merge($this->_tables, $context['tables']);
+ }
}
/**
));
// Create tagger
- $this->tagger = new Content_Tagger();
- $this->tagger->setDbAdapter($this->db);
+ $this->tagger = new Content_Tagger(array('dbAdapter' => $this->db));
// Read sql schema file
$statements = array();