Skip to content

Instantly share code, notes, and snippets.

@manuakasam
Created January 3, 2013 19:15
Show Gist options
  • Select an option

  • Save manuakasam/4446157 to your computer and use it in GitHub Desktop.

Select an option

Save manuakasam/4446157 to your computer and use it in GitHub Desktop.
Strategy implementation
<?php
namespace Haushaltportal\Stdlib\Hydrator\Strategy;
use Zend\Stdlib\Hydrator\Strategy\StrategyInterface;
class ProduktbereichStrategy implements StrategyInterface
{
/**
* {@inheritDoc}
*/
public function extract($value)
{
if (is_numeric($value) || $value === null) {
return $value;
}
return $value->getId();
}
/**
* {@inheritDoc}
*/
public function hydrate($value)
{
return $value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment