本文整理汇总了PHP中DataMapper::get方法的典型用法代码示例。如果您正苦于以下问题:PHP DataMapper::get方法的具体用法?PHP DataMapper::get怎么用?PHP DataMapper::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataMapper
的用法示例。
在下文中一共展示了DataMapper::get方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
function get()
{
parent::get();
if ($this->username == null) {
throw new UserNotFound();
}
}
示例2: __construct
public function __construct()
{
foreach ($this->objects as $map) {
$this->{strtolower($map . 'mapper')} = DataMapper::get($map);
}
$this->template = new Templater();
}
示例3: get
/**
* Overwrite of the get() function to add filters to the search.
* Refer to DataMapper ORM for get() function details.
*
* @author Woxxy
* @param integer|NULL $limit Limit the number of results.
* @param integer|NULL $offset Offset the results when limiting.
* @return DataMapper Returns self for method chaining.
*/
public function get($limit = NULL, $offset = NULL)
{
// Get the CodeIgniter instance, since it isn't set in this file.
$CI =& get_instance();
// Check if the user is allowed to see protected chapters.
if (!$CI->tank_auth->is_allowed()) {
$this->where('hidden', 0);
}
$result = parent::get($limit, $offset);
$this->get_licenses();
$CI =& get_instance();
if (!$CI->tank_auth->is_allowed() && !$CI->tank_auth->is_team()) {
// Remove from the array the serie licensed in the user's nation
foreach ($this->all as $key => $item) {
if (in_array($CI->session->userdata('nation'), $this->licenses)) {
unset($this->all[$key]);
}
}
if (in_array($CI->session->userdata('nation'), $this->licenses)) {
$this->clear();
}
}
// let's put the result in a small cache, since teams are always the same
foreach ($this->all as $comic) {
// if it's not yet cached, let's cache it
if (!$this->get_cached($comic->id)) {
if (count(self::$cached) > 10) {
array_shift(self::$cached);
}
self::$cached[] = $comic->get_clone();
}
}
return $result;
}
示例4: get
public function get()
{
parent::get();
if ($this->name == null) {
throw new Task_Not_Found();
}
}
示例5: __construct
public function __construct($id = null)
{
if (!is_null($id)) {
$this->setID($id);
}
$this->validator = new Validator();
$this->validator->setStoreErrors(true);
$this->mapper = DataMapper::get(get_class($this));
}
示例6: get
/**
* Overwrite of the get() function to add filters to the search.
* Refer to DataMapper ORM for get() function details.
*
* @author Woxxy
* @param integer|NULL $limit Limit the number of results.
* @param integer|NULL $offset Offset the results when limiting.
* @return DataMapper Returns self for method chaining.
*/
public function get($limit = NULL, $offset = NULL)
{
// Get the CodeIgniter instance, since it isn't set in this file.
$CI =& get_instance();
// Check if the user is allowed to see protected chapters.
if (!$CI->tank_auth->is_allowed()) {
$this->where('hidden', 0);
}
return parent::get($limit, $offset);
}
示例7: get
/**
* Overwrite of the get() function to add filters to the search.
* Refer to DataMapper ORM for get() function details.
*
* @author Woxxy
* @param integer|NULL $limit Limit the number of results.
* @param integer|NULL $offset Offset the results when limiting.
* @return DataMapper Returns self for method chaining.
*/
public function get($limit = NULL, $offset = NULL)
{
// Get the CodeIgniter instance, since it isn't set in this file.
$CI =& get_instance();
// Check if the user is allowed to see protected chapters.
if (!$CI->tank_auth->is_allowed()) {
$this->where('hidden', 0);
}
$result = parent::get($limit, $offset);
foreach ($this->all as $key => $item) {
if (!$item->get_comic()) {
unset($this->all[$key]);
}
}
return $result;
}
示例8: get
/**
* Overwrite of the get() function to add filters to the search.
* Refer to DataMapper ORM for get() function details.
*
* @author Woxxy
* @param integer|NULL $limit Limit the number of results.
* @param integer|NULL $offset Offset the results when limiting.
* @return DataMapper Returns self for method chaining.
*/
public function get($limit = NULL, $offset = NULL)
{
$result = parent::get($limit, $offset);
// let's put the result in a small cache, since teams are always the same
if ($this->result_count() > 0) {
foreach ($this->all as $team) {
// if it's not yet cached, let's cache it
if (!$this->get_cached($team->id)) {
if (count(self::$cached) > 10) {
array_shift(self::$cached);
}
self::$cached[] = $team->get_clone();
}
}
}
return $result;
}
示例9: get
/**
* Overwrite of the get() function to add filters to the search.
* Refer to DataMapper ORM for get() function details.
*
* @author Woxxy
* @param integer|NULL $limit Limit the number of results.
* @param integer|NULL $offset Offset the results when limiting.
* @return DataMapper Returns self for method chaining.
*/
public function get($limit = NULL, $offset = NULL) {
// Get the CodeIgniter instance, since it isn't set in this file.
$CI = & get_instance();
// Check if the user is allowed to see protected chapters.
if (!$CI->tank_auth->is_allowed()) {
$this->where('hidden', 0);
}
$result = parent::get($limit, $offset);
$this->get_licenses();
$CI = & get_instance();
if (!$CI->tank_auth->is_allowed() && !$CI->tank_auth->is_team()) {
// Remove from the array the comics licensed in the user's nation
foreach ($this->all as $key => $item) {
if (in_array($CI->session->userdata('nation'), $this->licenses)) {
unset($this->all[$key]);
}
}
if (in_array($CI->session->userdata('nation'), $this->licenses)) {
$this->clear();
}
}
return $result;
}
示例10: get
/**
* Get (overload)
*
* Get objects.
*
* @access public
* @param int or array
* @return bool
*/
function get($limit = NULL, $offset = NULL)
{
$this->_prepare_for_query();
return parent::get($limit, $offset);
}
示例11: get
public function get($limit = NULL, $offset = NULL)
{
// reset changed relation
if (!empty($this->parent)) {
if (array_key_exists('object', $this->parent) && array_key_exists('this_field', $this->parent)) {
$object = $this->parent['object'];
$this_field = $this->parent['this_field'];
if (array_key_exists($this_field, $object->original_related_values)) {
unset($object->original_related_values[$this_field]);
}
if (array_key_exists($this_field, $object->changed_related_values)) {
unset($object->changed_related_values[$this_field]);
}
}
}
return parent::get($limit, $offset);
}
示例12: get
public function get()
{
$return = parent::get();
$this->checkForAchieveOrNot();
$this->_setDoneTime();
return $return;
}
示例13:
function get_deteted($limit = NULL, $offset = NULL)
{
$this->where('status', STATUS_DELETED);
parent::get($limit, $offset);
}
示例14: get_slim
public function get_slim($limit = NULL, $offset = NULL)
{
return parent::get($limit, $offset);
}