@param string $sId - shop category id

@return bool
973098
public function load($sId)
    {
        $category = TdbShopCategory::GetNewInstance($sId);
        if (false === $category->AllowDisplayInShop() || false == $category->fieldActive) {
            return false;
        }

        return $this->loadFromNode($category);
    }
114435
public function canDelete($store_id)
    {
        if ($this->isDefault($store_id)) {
            return false;
        }

        $sql = 'SELECT NOT EXISTS (SELECT store_id FROM product WHERE store_id=:id)
                AND NOT EXISTS (SELECT store_id FROM category_group WHERE store_id=:id)
                AND NOT EXISTS (SELECT store_id FROM page WHERE store_id=:id)
                AND NOT EXISTS (SELECT store_id FROM orders WHERE store_id=:id)
                AND NOT EXISTS (SELECT store_id FROM cart WHERE store_id=:id)
                AND NOT EXISTS (SELECT store_id FROM user WHERE store_id=:id)';

        return (bool) $this->db->fetchColumn($sql, array('id' => $store_id));
    }
243525
public function findBySid($sid, $columns = [])
    {
        try {
            return $this->findBySidOrFail($sid, $columns);
        } catch (ModelNotFoundException $e) {
            return false;
        }
    }
844533
private function getStoreId(Category $category)
    {
        $storeId = $category->getStoreId();

        if ($storeId === 0) {
            $defaultStoreId   = $this->getDefaultStoreId();
            $categoryStoreIds = array_filter($category->getStoreIds());
            $storeId        = current($categoryStoreIds);
            if (in_array($defaultStoreId, $categoryStoreIds)) {
                $storeId = $defaultStoreId;
            }
        }

        return $storeId;
    }
328334
public function getDeleteVariantJson($sid)
    {
        $status = false;
        $message = Lang::get('redminportal::messages.error_delete_entry');
        
        $product = Product::find($sid);
        
        // No such id
        if ($product == null) {
            return json_encode(array('status' => $status, 'message' => $message));
        }
        
        // Check if there's any order related to this product
        if (count($product->orders) > 0) {
            $message = Lang::get('redminportal::messages.error_delete_product_already_ordered');
            return json_encode(array('status' => $status, 'message' => $message));
        }
        
        // Delete the product
        $result = $product->delete();
        
        if ($result) {
            $status = true;
            $message = Lang::get('redminportal::messages.success_delete_record');
        }

        return json_encode(array('status' => $status, 'message' => $message));
    }
668819
public function getContext($sid) {
        return new ReservationContext(
            $this->version,
            $this->solution['workspaceSid'],
            $this->solution['taskSid'],
            $sid
        );
    }
1144505
public function getDelete($sid)
    {
        $model = $this->model->find($sid);
        
        if ($model == null) {
            $errors = new MessageBag;
            $errors->add('deleteError', trans('redminportal::messages.error_delete_entry'));
            return redirect()->back()->withErrors($errors);
        }
        
        $model->delete();
        
        return redirect()->back();
    }
1170115
public function session_exists($sid) {
        if (!$this->servers) {
            return false;
        }

        // Go through the list of all servers because
        // we do not know where the session handler put the
        // data.

        foreach ($this->servers as $server) {
            list($host, $port) = $server;
            $memcached = new \Memcached();
            $memcached->addServer($host, $port);
            $value = $memcached->get($this->prefix . $sid);
            $memcached->quit();
            if ($value !== false) {
                return true;
            }
        }

        return false;
    }
1127812
private function getCategory()
    {
        $storeId    = $this->getStoreId();
        $categoryId = $this->getCategoryId();
        $category   = null;

        if ($this->getCategoryId()) {
            $category = $this->categoryRepository->get($categoryId, $storeId);
        }

        return $category;
    }
362501
public function hasSkipDiscountCategories()
    {
        if ($this->_hasSkipDiscountCategories === null || $this->_blReload) {
            $sViewName = getViewName('oxcategories');
            $sQ = "select 1 from {$sViewName} where {$sViewName}.oxactive = 1 and {$sViewName}.oxskipdiscounts = '1' ";

            $this->_hasSkipDiscountCategories = (bool) \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sQ);
        }

        return $this->_hasSkipDiscountCategories;
    }
584963
public function getContext($sid) {
        return new AuthCallsCredentialListMappingContext(
            $this->version,
            $this->solution['accountSid'],
            $this->solution['domainSid'],
            $sid
        );
    }
729321
public function current($sid=NULL) {
  if (!isset($sid)) $sid = $this->getSID();
  $query = new \Peyote\Select('sessions');
  $query->columns('user_id')
        ->where('sid', '=', $sid)
        ->limit(1);
  $user = $this->db->fetch($query);
  $user_id = NULL;
  if (isset($user[0]['user_id'])) {
   $user_id = $user[0]['user_id'];
   try {
    $current = $this->get($user_id);
   }
   catch(\Exception $e) {
    if ($e->getCode() == 1200) {
     $current = FALSE;
    }
    else {
     throw new \Exception($e);
    }
   }
   $query = new \Peyote\Update('sessions');
   $query->set([
                'last_access' => date('Y-m-d H:i:s')
               ])
         ->where('sid', '=', $sid);
   $this->db->fetch($query);
  }
  else {
   $current = FALSE;
  }
 return $current;
 }
1288100
public function IsInCategoryPath($sCategoryId)
    {
        $oBreadCrumb = $this->GetBreadcrumb();
        $oMatchingNode = $oBreadCrumb->FindItemWithProperty('id', $sCategoryId);
        if ($oMatchingNode) {
            return true;
        } else {
            return false;
        }
    }
779606
protected static function getNameAndId($mNameId, &$sName, &$sId)
    {
        if (is_array($mNameId))
        {
            $sName = $mNameId[0];
            $sId = !empty($mNameId[1]) ? $mNameId[1] : null;
        }
        else {
            $sName = $sId = $mNameId;
        }
    }
1191841
public function findBySidOrFail($sid, $columns = [])
    {
        return $this->findByOrFail($this->schema->objectSid(), $sid, $columns);
    }
929626
public function write($sid, $data)
    {
        $data = $this->encrypt($data, $this->key);

        return parent::write($sid, $data);
    }
820362
public static function GetInstance($sId)
    {
        $oElement = TdbPkgShopAffiliate::GetNewInstance();
        $oElement->Load($sId);
        if (!empty($oElement->sqlData['class'])) {
            $sClassName = $oElement->sqlData['class'];
            $oElementNew = new $sClassName();
            $oElementNew->LoadFromRow($oElement->sqlData);
            $oElement = $oElementNew;
        }

        return $oElement;
    }