* @author Dennis Eichhorn * @copyright Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ namespace Modules\Billing\Admin\Install; use phpOMS\DataStorage\Database\DatabaseType; use phpOMS\DataStorage\Database\DatabasePool; /** * Media addition class. * * @category Modules * @package Modules\Admin * @author OMS Development Team * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ class ItemReference { /** * {@inheritdoc} */ public static function install(string $path, DatabasePool $dbPool, InfoManager $info) { switch ($dbPool->get('core')->getType()) { case DatabaseType::MYSQL: $dbPool->get('core')->con->prepare( 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'billing_invoice_element` ADD KEY `billing_invoice_element_article` (`billing_invoice_element_article`), ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'billing_invoice_element_ibfk_2` FOREIGN KEY (`billing_invoice_element_article`) REFERENCES `' . $dbPool->get('core')->prefix . 'itemreference` (`itemreference_id`);' )->execute(); break; } } }