diff options
Diffstat (limited to 'src/exceptions/invalid_display_type.php')
-rw-r--r-- | src/exceptions/invalid_display_type.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/exceptions/invalid_display_type.php b/src/exceptions/invalid_display_type.php new file mode 100644 index 0000000..925c9f1 --- /dev/null +++ b/src/exceptions/invalid_display_type.php @@ -0,0 +1,39 @@ +<?php +/** + * File containing the ezcGraphInvalidDisplayTypeException class + * + * @package Graph + * @version //autogen// + * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * Exception thrown when an unsupported data type is set for the current chart. + * + * @package Graph + * @version //autogen// + */ +class ezcGraphInvalidDisplayTypeException extends ezcGraphException +{ + public function __construct( $type ) + { + $chartTypeNames = array( + ezcGraph::PIE => 'Pie', + ezcGraph::LINE => 'Line', + ezcGraph::BAR => 'Bar', + ); + + if ( isset( $chartTypeNames[$type] ) ) + { + $chartTypeName = $chartTypeNames[$type]; + } + else + { + $chartTypeName = 'Unknown'; + } + + parent::__construct( "Invalid data set display type <$type> (<$chartTypeName>) for current chart." ); + } +} + +?> |