Skip to content

Instantly share code, notes, and snippets.

@vonglasow
Created January 31, 2014 10:17
Show Gist options
  • Save vonglasow/8729597 to your computer and use it in GitHub Desktop.
Save vonglasow/8729597 to your computer and use it in GitHub Desktop.
Archi
<?php
namespace A;
use Zend;
class Data
{
protected $limit;
// ...
public function run()
{
return $this->limit; // ?
return $this->options->limit; // ?
}
public function setLimit($limit)
{
if (0 == $limit) {
return;
}
$this->limit = (int) abs($limit);
}
public function getLimit()
{
return $this->limit;
}
public function addOptions(Zend\Console\Getopt $options)
{
$this->setLimit($options->limit ?: 10);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment