Skip to content

Commit

Permalink
Merge pull request #1 from kokspflanze/build-error
Browse files Browse the repository at this point in the history
Build error
  • Loading branch information
kokspflanze committed Apr 16, 2015
2 parents da614c2 + 5f35aee commit 1074b29
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ZfcDatagrid/Column/Formatter/GenerateLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(ServiceManager $sm, $route, $key = null, $params = [
}

/**
* @param AbstractColumn $columnUniqueId
* @param AbstractColumn $column
* @return string
*/
public function getFormattedValue(AbstractColumn $column)
Expand Down
7 changes: 7 additions & 0 deletions src/ZfcDatagrid/Column/Type/AbstractType.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ public function getUserValue($val)
{
return $val;
}

/**
* Get the type name
*
* @return string
*/
abstract public function getTypeName();
}
7 changes: 5 additions & 2 deletions src/ZfcDatagrid/Column/Type/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class DateTime extends AbstractType
*
* @param string $sourceDateTimeFormat
* PHP DateTime format
* @param unknown $outputDateType
* @param unknown $outputTimeType
* @param int $outputDateType
* @param int $outputTimeType
* @param string $locale
* @param string $sourceTimezone
* @param string $outputTimezone
Expand All @@ -60,6 +60,9 @@ public function __construct($sourceDateTimeFormat = 'Y-m-d H:i:s', $outputDateTy
$this->setOutputTimezone($outputTimezone);
}

/**
* @return string
*/
public function getTypeName()
{
return 'dateTime';
Expand Down
3 changes: 3 additions & 0 deletions src/ZfcDatagrid/Column/Type/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class Image extends AbstractType
*/
protected $resizeHeight = 20.5;

/**
* @return string
*/
public function getTypeName()
{
return 'image';
Expand Down
28 changes: 28 additions & 0 deletions src/ZfcDatagrid/DataSource/AbstractDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ abstract class AbstractDataSource implements DataSourceInterface
*/
protected $paginatorAdapter;

/**
* Set the data source
* - array
* - ZF2: Zend\Db\Sql\Select
* - Doctrine2: Doctrine\ORM\QueryBuilder
* - ...
*
* @param mixed $data
*/
public function __construct($data)
{
// we need this exception, because a abstract __construct, create a exception in php-unit for mocking
throw new \Exception(sprintf('Missing __construct in %s', get_class($this)));
}

/**
* Set the columns
*
Expand Down Expand Up @@ -126,4 +141,17 @@ public function getPaginatorAdapter()
{
return $this->paginatorAdapter;
}

/**
* Get the data back from construct
* @return mixed
*/
abstract public function getData();

/**
* Execute the query and set the paginator
* - with sort statements
* - with filters statements
*/
abstract public function execute();
}
34 changes: 34 additions & 0 deletions src/ZfcDatagrid/Renderer/AbstractRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@

abstract class AbstractRenderer implements RendererInterface
{
/**
*
* @var array
*/
protected $options = [];

/**
*
* @var string
*/
protected $title;

/**
Expand Down Expand Up @@ -700,4 +708,30 @@ public function prepareViewModel(Datagrid $grid)

$viewModel->setVariable('exportRenderers', $grid->getExportRenderers());
}

/**
* Return the name of the renderer
* @return string
*/
abstract public function getName();

/**
* Determine if the renderer is for export
* @return boolean
*/
abstract public function isExport();

/**
* Determin if the renderer is HTML
* It can be export + html -> f.x.
* printing for HTML
* @return boolean
*/
abstract public function isHtml();

/**
* Execute all...
* @return ViewModel Response\Stream
*/
abstract public function execute();
}

0 comments on commit 1074b29

Please sign in to comment.