Created
January 31, 2014 10:17
-
-
Save vonglasow/8729597 to your computer and use it in GitHub Desktop.
Archi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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