'rewards_sponsorship_code', 'primary' => 'id_sponsor', 'fields' => array( 'id_sponsor' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'code' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true, 'size' => 20) ), ); public static function getIdSponsorByCode($code) { return Db::getInstance()->getValue("SELECT `id_sponsor` FROM `"._DB_PREFIX_."rewards_sponsorship_code` WHERE code='".pSQL($code)."'"); } }