Overview

Namespaces

  • pgn
    • exceptions
    • tags
  • utils

Classes

  • pgn\Game
  • pgn\PGN
  • pgn\tags\Annotator
  • pgn\tags\Black
  • pgn\tags\BlackElo
  • pgn\tags\BlackNA
  • pgn\tags\BlackTitle
  • pgn\tags\BlackType
  • pgn\tags\BlackUSCF
  • pgn\tags\Board
  • pgn\tags\Date
  • pgn\tags\ECO
  • pgn\tags\Event
  • pgn\tags\EventCountry
  • pgn\tags\EventDate
  • pgn\tags\EventRounds
  • pgn\tags\EventSponsor
  • pgn\tags\EventType
  • pgn\tags\FEN
  • pgn\tags\Mode
  • pgn\tags\NIC
  • pgn\tags\Opening
  • pgn\tags\PlyCount
  • pgn\tags\Result
  • pgn\tags\Round
  • pgn\tags\Section
  • pgn\tags\SetUp
  • pgn\tags\Site
  • pgn\tags\Source
  • pgn\tags\SourceDate
  • pgn\tags\Stage
  • pgn\tags\SubVariation
  • pgn\tags\Tag
  • pgn\tags\Termination
  • pgn\tags\Time
  • pgn\tags\TimeControl
  • pgn\tags\UknownTag
  • pgn\tags\UTCDate
  • pgn\tags\UTCTime
  • pgn\tags\Variation
  • pgn\tags\White
  • pgn\tags\WhiteElo
  • pgn\tags\WhiteNA
  • pgn\tags\WhiteTitle
  • pgn\tags\WhiteType
  • pgn\tags\WhiteUSCF
  • utils\Parser
  • utils\String

Exceptions

  • pgn\exceptions\InvalidClassNameException
  • pgn\exceptions\InvalidDataException
  • pgn\exceptions\InvalidGameFormatException
  • pgn\exceptions\InvalidGamePathException
  • pgn\exceptions\PGNException
  • utils\ParserException
  • Overview
  • Namespace
  • Class
 1: <?php
 2: /* 
 3:  * Copyright (c) 2016 Geraldo B. Landre
 4:  * 
 5:  * See the file LICENSE for copying permission.
 6:  */
 7: namespace pgn\tags;
 8: 
 9: use pgn\exceptions\InvalidClassNameException;
10: 
11: /**
12:  * Represents an unrecognized tag
13:  *
14:  * @author Geraldo
15:  */
16: class UknownTag extends Tag {
17:     /**
18:      *
19:      * @var string 
20:      */
21:     private $className;
22:     
23:     /**
24:      * 
25:      * @param string $name
26:      * @throws InvalidClassNameException
27:      */
28:     public function setName($name) {
29:         if(is_string($name)) {
30:             $this->className = $name;
31:         }
32:         else {
33:             throw new InvalidClassNameException("[" . __CLASS__ . "] bad name: " . $name);
34:         }
35:     }
36:     
37:     /**
38:      * 
39:      * @return string name of the class
40:      * @throws InvalidClassNameException if className was not set
41:      */
42:     public function getName() {
43:         if(!empty($this->className)) {
44:             return $this->className;
45:         }
46:         throw new InvalidClassNameException("[" . __CLASS__ . "] name was not set for an uknown tag");
47:     }
48: }
49: 
API documentation generated by ApiGen