public function addFlag($flag) { parent::addFlag($flag); if ($this->hasFlag(self::AF_DUMMY_SHOW_LABEL)) { $this->removeFlag(self::AF_BLANK_LABEL); } }
/** * Adds the self::AF_OBLIGATORY flag to the attribute. * * @param int $flags The flag to add to the attribute * * @return Attribute The instance of this Attribute */ public function addFlag($flags) { // setting self::AF_OBLIGATORY has no use, so prevent setting it. if (Tools::hasFlag($flags, self::AF_OBLIGATORY)) { $flags &= ~self::AF_OBLIGATORY; } // except if someone really really really wants to show this attribute is obligatory if (Tools::hasFlag($flags, self::AF_BOOL_OBLIGATORY)) { $flags |= self::AF_OBLIGATORY; } return parent::addFlag($flags); }