/** * Overrides the parent isValid check to add an additional check to ensure * the license number matches the correct patterns. * * @see License::isValid() * @return bool TRUE if the license is valid, FALSE if not. */ public function isValid() { if (parent::isValid() === FALSE) { return FALSE; } $valid = $this->validLicenseNumber(); if (!$valid) { $this->errors['invalid_license_number'] = "The license number is invalid"; } return $valid; }