Skip to content

Instantly share code, notes, and snippets.

@oliverlundquist
Created October 8, 2015 02:17
Show Gist options
  • Save oliverlundquist/afcb120ad66fc3ddc5eb to your computer and use it in GitHub Desktop.
Save oliverlundquist/afcb120ad66fc3ddc5eb to your computer and use it in GitHub Desktop.
<?php
trait MetaProperties {
public function getLimit() {
return $this->limit;
}
public function setLimit($limit) {
$this->limit = $limit <= $this->maxLimit ? $limit : $this->maxLimit;
}
}
class Categories {
use MetaProperties;
protected $offset = 0;
protected $limit = 100;
protected $sort = 'id';
protected $direction = 'asc';
protected $maxLimit = 100;
}
class Orders {
use MetaProperties;
protected $offset = 0;
protected $limit = 1000;
protected $sort = 'id';
protected $direction = 'asc';
protected $maxLimit = 1000;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment