get category with id
@param $id
@param $type
@return Categories
357579
function getCategory($id){
        if(is_numeric($id))
            $model=self::where('id',$id)->select();
        else
            $model=self::where('slug',$id)->select();

        $model->where('model_type',$this->modelType);

        return $model->first();
    }
1056537
public function getTypeById( $id, $prefix = null )
	{
		if ( ! isset( $this->typeIds[ $id ] ) ) return false;
		return isset( $this->typeIds[ $id ]['istype'] ) && $this->typeIds[ $id ]['istype']
			? $this->getType( $this->typeIds[ $id ]['name'], $prefix )
			: $this->getElement( $this->typeIds[ $id ]['name'], $prefix );
	}
376748
protected function idToUri($ids, $type)
    {
        $type = 'spotify:' . $type . ':';

        $ids = array_map(function ($id) use ($type) {
            if (substr($id, 0, strlen($type)) != $type) {
                $id = $type . $id;
            }

            return $id;
        }, (array) $ids);

        return (count($ids) == 1) ? $ids[0] : $ids;
    }
177186
function GetById($type, $id){
        $newClass = NAMESPACE_ENTITIES . $type;
        if(class_exists ($newClass)) {
            $class = new $newClass();
            $primaryKey = ModelState::GetPrimary($class);
            if ($primaryKey != null)
                return $this->Get($type, $primaryKey . '=' . $id)->FirstOrDefault();

            return null;
        }

        throw new OwlException("Classe {$newClass} não encontrada", 1);
    }
253236
public function problem($id, $type = 'id')
    {
        $problem = $this->load('p', array($type, $id));

        return Helper\formatProblem($problem);
    }
1057914
public function delPermissionCategory($id = 0)
    {
        $model = new PermissionCategory($this->db);
        try {
            $res = $model->delCategory($id);
            return $res;
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }
    }
1084590
public static function findByCategoryId( $categoryId ) {

		$optionTable = CoreTables::getTableName( CoreTables::TABLE_OPTION );

		return self::find()->where( "$optionTable.categoryId=:id", [ ':id' => $categoryId ] )->all();
	}
1036400
public function getEntityPath($type, $id)
    {
        // Allow other modules to interact
        $event = new EntityGetPathEvent($type, $id);
        $this->eventDispatcher->dispatch(EntityGetPathEvent::EVENT_GET_PATH, $event);
        if ($path = $event->getPath()) {
            return $path;
        }

        // In most cases, this will be used for nodes only, so just set the
        // node URL.
        // It will avoid nasty bugs, since the 'text' core module does sanitize
        // (and call check_markup()) during field load if there are any circular
        // links dependencies between two nodes, it triggers an finite loop.
        // This will also make the whole faster.
        // @todo If node does not exists, no error will be triggered.
        if ('node' === $type) {
            return 'node/' . $id;
        }

        $entity = $this->entityManager->getStorage($type)->load($id);
        if (!$entity) {
            throw new \InvalidArgumentException(sprintf("entity of type %s with identifier %s does not exist", $type, $id));
        }

        if (!$entity instanceof EntityInterface) {
            return $this->getDrupalEntityPath($type, $entity);
        } else {
            return $entity->url();
        }
    }
108825
public static function getCategoryAssociations($id = 0, $extension = 'com_content')
	{
		$return = array();

		if ($id)
		{
			// Load route helper
			jimport('helper.route', JPATH_COMPONENT_SITE);
			$helperClassname = ucfirst(substr($extension, 4)) . 'HelperRoute';

			$associations = CategoriesHelper::getAssociations($id, $extension);

			foreach ($associations as $tag => $item)
			{
				if (class_exists($helperClassname) && is_callable(array($helperClassname, 'getCategoryRoute')))
				{
					$return[$tag] = $helperClassname::getCategoryRoute($item, $tag);
				}
				else
				{
					$return[$tag] = 'index.php?option=' . $extension . '&view=category&id=' . $item;
				}
			}
		}

		return $return;
	}
137607
public function getCoverUrl($id, $type)
    {
        switch ($type) {
            case self::ITEM_TYPE_ANIMATION:
                return $this->browser->getHost().'/'.$type.'/img/'.(ceil($id / 1000) * 1000).'/'.$id.'/1.jpg';
            case self::ITEM_TYPE_CINEMA:
                return $this->browser->getHost().'/'.$type.'/img/'.(ceil($id / 10000) * 10000).'/'.$id.'/1.jpg';
            default:
                return;
        }
    }
1214864
static function &get_reference( $type, $id ) {
		if( empty( self::$stack[ $type ][ $id ] ) ){
			$null = null;
			return $null;
		}	
		else {
			return self::$stack[ $type ][ $id ];
		}
	}
903565
public function resourceLinkMeta(string $type, string $id): array
    {
        foreach ($this->resourceMap as $resourceLink) {
            if (isset($resourceLink["meta"]) && $resourceLink["type"] === $type && $resourceLink["id"] === $id) {
                return $resourceLink["meta"];
            }
        }

        return [];
    }
229691
protected function getMorphs(string $name, string $type = null, string $id = null): array
    {
        return [
            $type ?: $name.'_type',
            $id ?: $name.'_id',
        ];
    }
40613
public function loadSlideFile($type, $id) {
        $query = $this->connection->select('file_usage', 'n');
        $query->fields('n', array('fid'));
        $query->condition('n.module', 'site_sliders');
        $query->condition('n.type', $type);
        $query->condition('n.id', $id);
        $fid = $query->execute()->fetchField(); 
        
        $file = NULL;
        if ($fid) {
            $file = File::load($fid);
        }     
        return $file; 
    }
539833
protected static function getMorphs($name, $type, $id)
    {
        $type = $type ?: $name.'_type';

        $id = $id ?: $name.'_id';

        return [$type, $id];
    }
593089
public function getByToken(int $id, string $token, int $type = self::TOKEN_TYPE_REMEMBER) : ?Authenticatable
    {
        return $type === self::TOKEN_TYPE_REMEMBER ?  $this->getByRememberToken($id, $token) : $this->getByApiToken($id, $token);
    }
1167618
public function getCategoryAction($id)
    {
        $category = $this->getCategoryManager()->getCategory($id);
        if (null === $category) {
            throw new NotFoundHttpException("Classcontent's category `$id` not found.");
        }

        return $this->createJsonResponse($category);
    }