Check whether follower exist using given follower id, parent id and type.

@param integer $modelId
@param integer $parentId
@param integer $type
@return boolean
191766
public static function isExistByFollower( $modelId, $parentId, $type = self::TYPE_FOLLOW ) {

		$follower = self::findByFollower( $modelId, $parentId, $type );

		return isset( $follower );
	}
1319861
public function getFollowersIdList( $parentId, $parentType ) {

        return self::findList( [  'column' => 'modelId', 'conditions' => [ 'type' => IFollower::TYPE_FOLLOW, 'active' => true, 'parentId' => $parentId, 'parentType' => $parentType ] ] );
    }
1151386
protected function _areModelIdsSortedByRule(array $modelIds) {
        $rules = $this->_getRules();

        foreach ($modelIds as $modelId) {
            $ruleNumber = array_search($modelId, $rules);
            if ($ruleNumber !== false) {
                return $rules[$ruleNumber] === $modelIds[$ruleNumber];
            }
        }
    }
478597
public static function findByUser( $parentId, $parentType, $userId, $type = ModelComment::TYPE_COMMENT ) {

		return static::find()->where( 'parentId=:pid AND parentType=:ptype AND createdBy=:uid AND type=:type', [ ':pid' => $parentId, ':ptype' => $parentType, ':uid' => $userId, ':type' => $type ] )->one();
	}
165384
public function createInHierarchy( $parentId, $parentType, $rootId, $childId ) {

		$root = $this->getRoot( $rootId, $parentType );

		// Add Root
		if( !isset( $root ) ) {

			$model	= $this->getModelObject();

			$model->rootId		= $rootId;
			$model->parentType	= $parentType;
			$model->lValue		= CoreGlobal::HIERARCHY_VALUE_L;
			$model->rValue		= CoreGlobal::HIERARCHY_VALUE_R;

			// Create Model
			$model->save();
		}

		$model	= $this->getModelObject();

		$model->rootId		= $rootId;
		$model->parentType	= $parentType;

		$model->parentId	= $parentId;
		$model->childId		= $childId;

		// Create Model
		$model->save();
	}
578589
public function getActiveCategoryIdList( $categoryId, $parentType ) {

		$modelClass	= static::$modelClass;

		$models = $modelClass::findActiveByCategoryIdParentType( $categoryId, $parentType );
		$ids	= [];

		foreach ( $models as $model ) {

			$category = $model->category;

			$ids[] = $category->id;
		}

		return $ids;
	}
790262
public function countChildren($parentId, $siteId)
    {
        $qa = $this->createAggregationQuery();
        $qa->match(
            array(
                'siteId'     => $siteId,
                'parent.$id' => new \MongoId($parentId)
            )
        );

        return $this->countDocumentAggregateQuery($qa);
    }
1081506
def parent_id?(item)
      parent.id && item.send(foreign_key).eql?(parent.id)
    end
1147715
public function saveImageAjaxAction($parentId, $parentType)
    {
        $config = FileConfiguration::getImageConfig();
        return $this->saveFileAjaxAction(
            $parentId,
            $parentType,
            $config['objectType'],
            $config['validMimeTypes'],
            $config['extBlackList']
        );
    }
135892
public function belongsTo( $parent, $parentType ) {

		return $this->parentId == $parent->id && $this->parentType == $parentType;
	}
1375052
public function getNameValueMapByType( $parentId, $parentType, $type ) {

		$config = [];

		$config[ 'conditions' ][ 'parentId' ]	= $parentId;
		$config[ 'conditions' ][ 'parentType' ] = $parentType;
		$config[ 'conditions' ][ 'type' ]		= $type;

		return $this->getNameValueMap( $config );
	}
861649
public function getCountByParent( $parentId, $parentType ) {

		$modelClass	= static::$modelClass;

		return $modelClass::queryByParent( $parentId, $parentType )->count();
	}
214837
private function parentIsNot($conjunction, ModelId $parentModelId)
    {
        if (!empty($this->expression)) {
            $this->expression[] = $conjunction;
        }

        $index              = \count($this->variables);
        $this->expression[] = \sprintf(self::PARENT_IS_NOT_EXPRESSION, $index);
        $this->variables[]  = $parentModelId;
        $this->compiled     = null;

        return $this;
    }
1157514
public function get(Model $parent, Model $related, $type = [])
    {
        // Get the relationships for the parent node of the given type.
        $relationships = $this->getModelRelationsForType($parent, $type);

        $edges = [];
        // Collect the edges out of the found relationships.
        foreach ($relationships as $relationship)
        {
            // We need the direction so that we can generate an Edge[In|Out] instance accordingly.
            $direction = $this->directionFromRelation($relationship, $parent, $related);
            // Now that we have the direction and the relationship all we need to do is generate the edge
            // and add it to our collection of edges.
            $edges[] = $this->edgeFromRelationWithDirection($relationship, $parent, $related, $direction);
        }

        return new Collection($edges);
    }
1257155
public function isParentOf($itemId, $parentId)
    {
        $path = $this->getMelisKeyData($itemId);
        $paths = explode('/', $path);

        if (count($paths) > 0) {
            if (in_array($parentId, $paths)) {
                return true;
            }
        }

        return false;
    }
1289019
public function isActiveMapping( $parentId, $parentType ) {

		return $this->active && $this->parentId == $parentId && $this->parentType == $parentType;
	}
1131694
public static function findByParentModelIdType( $parentId, $parentType, $modelId, $type ) {

		return self::queryByParentModelId( $parentId, $parentType, $modelId )->andWhere( 'type=:type', [ ':type' => $type ] )->all();
	}