common/models/traits/mappers/ModelFollowerTrait.php
protected function generateFollowCounts() {

		$returnArr = [
			IFollower::TYPE_LIKE => [ 0 => 0, 1 => 0 ],
			IFollower::TYPE_DISLIKE => [ 0 => 0, 1 => 0 ],
			IFollower::TYPE_FOLLOW => [ 0 => 0, 1 => 0 ],
			IFollower::TYPE_WISHLIST => [ 0 => 0, 1 => 0 ]
		];

		$followerTable	= ModelFollower::tableName();
		$query			= new Query();

    	$query->select( [ 'type', 'active', 'count(id) as total' ] )
				->from( $followerTable )
				->where( [ 'parentId' => $this->id, 'parentType' => $this->modelType, 'active' => true ] )
				->groupBy( [ 'type', 'active' ] );

		$counts = $query->all();

		foreach( $counts as $count ) {

			$returnArr[ $count[ 'type' ] ][ $count[ 'active' ] ] = $count[ 'total' ];
		}

		return $returnArr;
	}
protected function generateFollowCounts() {

		$returnArr = [
			IFollower::TYPE_LIKE => [ 0 => 0, 1 => 0 ],
			IFollower::TYPE_DISLIKE => [ 0 => 0, 1 => 0 ],
			IFollower::TYPE_FOLLOW => [ 0 => 0, 1 => 0 ],
			IFollower::TYPE_WISHLIST => [ 0 => 0, 1 => 0 ]
		];

		$followerTable	= ModelFollower::tableName();
		$query			= new Query();

    	$query->select( [ 'type', 'active', 'count(id) as total' ] )
				->from( $followerTable )
				->where( [ 'parentId' => $this->id, 'parentType' => $this->modelType, 'active' => true ] )
				->groupBy( [ 'type', 'active' ] );

		$counts = $query->all();

		foreach( $counts as $count ) {

			$returnArr[ $count[ 'type' ] ][ $count[ 'active' ] ] = $count[ 'total' ];
		}

		return $returnArr;
	}
protected function generateFollowCounts ( ) { $ returnArr = [ IFollower :: TYPE_LIKE => [ 0 => 0 , 1 => 0 ] , IFollower :: TYPE_DISLIKE => [ 0 => 0 , 1 => 0 ] , IFollower :: TYPE_FOLLOW => [ 0 => 0 , 1 => 0 ] , IFollower :: TYPE_WISHLIST => [ 0 => 0 , 1 => 0 ] ] ; $ followerTable = ModelFollower :: tableName ( ) ; $ query = new Query ( ) ; $ query -> select ( [ 'type' , 'active' , 'count(id) as total' ] ) -> from ( $ followerTable ) -> where ( [ 'parentId' => $ this -> id , 'parentType' => $ this -> modelType , 'active' => true ] ) -> groupBy ( [ 'type' , 'active' ] ) ; $ counts = $ query -> all ( ) ; foreach ( $ counts as $ count ) { $ returnArr [ $ count [ 'type' ] ] [ $ count [ 'active' ] ] = $ count [ 'total' ] ; } return $ returnArr ; }
Generate and return the follow counts.

@return array
Generate and return the follow counts .