Skip to content

Instantly share code, notes, and snippets.

@veeranjik
Created March 27, 2018 14:35
Show Gist options
  • Save veeranjik/4153136639836fb5d5d44a7a4bcbc778 to your computer and use it in GitHub Desktop.
Save veeranjik/4153136639836fb5d5d44a7a4bcbc778 to your computer and use it in GitHub Desktop.
/** Class Name : FullCalendarSchCntr
* Description : Convenience class that can be used in Full calendar (getting Properties and Reservations)
* Created By : Veeranjaneyulu k
* Created On : 22nd March 2018
*
* Modification Log:
* --------------------------------------------------------------------------------------------------------------------------------------
* Developer Date Modification ID Description
* ---------------------------------------------------------------------------------------------------------------------------------------
**/
public class FullCalendarSchCntr {
/**
* @description : To get the properties with reservations
* @param :
* @return : List<Property__c>
**/
@AuraEnabled
public static List<Property__c> getReasource(){
//List<sObject> recordList = Database.query('select id,name from property__C where status=\'Active\'');
List<Property__c> proList =[select id,name ,(SELECT Name, Check_in__c, Check_out__c,Status__c,Property__r.Name,Property__c FROM Reservations__r where CALENDAR_YEAR(Check_in__c)= 2018) from Property__c where id in (select Property__c from Reservation__c where CALENDAR_YEAR(Check_in__c)= 2018) ];
return proList;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment