Skip to content

Commit

Permalink
Added Warning class and associated DataTable method
Browse files Browse the repository at this point in the history
  • Loading branch information
bggardner committed Dec 16, 2014
1 parent 259a3ac commit b41d854
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Base/Warning.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace Google\Visualization\DataSource\Base;

class Warning
{
protected $reasonType;
protected $messageToUser;

public function __construct($reasonType, $messageToUser)
{
$this->reasonType = $reasonType;
$this->messageToUser = $messageToUser;
}

public function getReasonType()
{
return $this->reasonType;
}

public function getMessage()
{
return $this->messageToUser;
}
}
?>
6 changes: 6 additions & 0 deletions DataTable/DataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Google\Visualization\DataSource\DataTable;

use Google\Visualization\DataSource\Base\TypeMismatchException;
use Google\Visualization\DataSource\Base\Warning;
use Google\Visualization\DataSource\DataTable\Value\Value;

class DataTable
Expand Down Expand Up @@ -131,6 +132,11 @@ public function getRow($rowIndex)
return $this->rows[$rowIndex];
}

public function addWarning(Warning $warning)
{
$this->warnings[] = $warning;
}

public function getWarnings()
{
return $this->warnings;
Expand Down

0 comments on commit b41d854

Please sign in to comment.