/** * generates a new attribute for the articles to * mark Trusted Shops articles */ private function generateAttribute() { $this->em->addAttribute('s_articles_attributes', 'swag', 'is_trusted_shops_article', 'tinyint(1)', true, 0); $this->em->addAttribute('s_articles_attributes', 'swag', 'trusted_range', 'int(11)', true, null); $this->em->addAttribute('s_articles_attributes', 'swag', 'trusted_duration', 'varchar(20)', true, null); $this->em->generateAttributeModels(array('s_articles_attributes')); try { $sql = "CREATE INDEX swag_trusted_range ON s_articles_attributes (swag_trusted_range);"; $this->db->query($sql); } catch (Exception $e) { } }