001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.shopping.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for ShoppingCoupon. This utility wraps
024     * {@link com.liferay.portlet.shopping.service.impl.ShoppingCouponLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see ShoppingCouponLocalService
032     * @see com.liferay.portlet.shopping.service.base.ShoppingCouponLocalServiceBaseImpl
033     * @see com.liferay.portlet.shopping.service.impl.ShoppingCouponLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class ShoppingCouponLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.shopping.service.impl.ShoppingCouponLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portlet.shopping.model.ShoppingCoupon addCoupon(
044                    long userId, java.lang.String code, boolean autoCode,
045                    java.lang.String name, java.lang.String description,
046                    int startDateMonth, int startDateDay, int startDateYear,
047                    int startDateHour, int startDateMinute, int endDateMonth,
048                    int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
049                    boolean neverExpire, boolean active, java.lang.String limitCategories,
050                    java.lang.String limitSkus, double minOrder, double discount,
051                    java.lang.String discountType,
052                    com.liferay.portal.service.ServiceContext serviceContext)
053                    throws com.liferay.portal.kernel.exception.PortalException {
054                    return getService()
055                                       .addCoupon(userId, code, autoCode, name, description,
056                            startDateMonth, startDateDay, startDateYear, startDateHour,
057                            startDateMinute, endDateMonth, endDateDay, endDateYear,
058                            endDateHour, endDateMinute, neverExpire, active, limitCategories,
059                            limitSkus, minOrder, discount, discountType, serviceContext);
060            }
061    
062            /**
063            * Adds the shopping coupon to the database. Also notifies the appropriate model listeners.
064            *
065            * @param shoppingCoupon the shopping coupon
066            * @return the shopping coupon that was added
067            */
068            public static com.liferay.portlet.shopping.model.ShoppingCoupon addShoppingCoupon(
069                    com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon) {
070                    return getService().addShoppingCoupon(shoppingCoupon);
071            }
072    
073            /**
074            * Creates a new shopping coupon with the primary key. Does not add the shopping coupon to the database.
075            *
076            * @param couponId the primary key for the new shopping coupon
077            * @return the new shopping coupon
078            */
079            public static com.liferay.portlet.shopping.model.ShoppingCoupon createShoppingCoupon(
080                    long couponId) {
081                    return getService().createShoppingCoupon(couponId);
082            }
083    
084            public static void deleteCoupon(
085                    com.liferay.portlet.shopping.model.ShoppingCoupon coupon) {
086                    getService().deleteCoupon(coupon);
087            }
088    
089            public static void deleteCoupon(long couponId)
090                    throws com.liferay.portal.kernel.exception.PortalException {
091                    getService().deleteCoupon(couponId);
092            }
093    
094            public static void deleteCoupons(long groupId) {
095                    getService().deleteCoupons(groupId);
096            }
097    
098            /**
099            * @throws PortalException
100            */
101            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
102                    com.liferay.portal.model.PersistedModel persistedModel)
103                    throws com.liferay.portal.kernel.exception.PortalException {
104                    return getService().deletePersistedModel(persistedModel);
105            }
106    
107            /**
108            * Deletes the shopping coupon with the primary key from the database. Also notifies the appropriate model listeners.
109            *
110            * @param couponId the primary key of the shopping coupon
111            * @return the shopping coupon that was removed
112            * @throws PortalException if a shopping coupon with the primary key could not be found
113            */
114            public static com.liferay.portlet.shopping.model.ShoppingCoupon deleteShoppingCoupon(
115                    long couponId)
116                    throws com.liferay.portal.kernel.exception.PortalException {
117                    return getService().deleteShoppingCoupon(couponId);
118            }
119    
120            /**
121            * Deletes the shopping coupon from the database. Also notifies the appropriate model listeners.
122            *
123            * @param shoppingCoupon the shopping coupon
124            * @return the shopping coupon that was removed
125            */
126            public static com.liferay.portlet.shopping.model.ShoppingCoupon deleteShoppingCoupon(
127                    com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon) {
128                    return getService().deleteShoppingCoupon(shoppingCoupon);
129            }
130    
131            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
132                    return getService().dynamicQuery();
133            }
134    
135            /**
136            * Performs a dynamic query on the database and returns the matching rows.
137            *
138            * @param dynamicQuery the dynamic query
139            * @return the matching rows
140            */
141            public static <T> java.util.List<T> dynamicQuery(
142                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
143                    return getService().dynamicQuery(dynamicQuery);
144            }
145    
146            /**
147            * Performs a dynamic query on the database and returns a range of the matching rows.
148            *
149            * <p>
150            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCouponModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
151            * </p>
152            *
153            * @param dynamicQuery the dynamic query
154            * @param start the lower bound of the range of model instances
155            * @param end the upper bound of the range of model instances (not inclusive)
156            * @return the range of matching rows
157            */
158            public static <T> java.util.List<T> dynamicQuery(
159                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
160                    int end) {
161                    return getService().dynamicQuery(dynamicQuery, start, end);
162            }
163    
164            /**
165            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
166            *
167            * <p>
168            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCouponModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
169            * </p>
170            *
171            * @param dynamicQuery the dynamic query
172            * @param start the lower bound of the range of model instances
173            * @param end the upper bound of the range of model instances (not inclusive)
174            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
175            * @return the ordered range of matching rows
176            */
177            public static <T> java.util.List<T> dynamicQuery(
178                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
179                    int end,
180                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
181                    return getService()
182                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
183            }
184    
185            /**
186            * Returns the number of rows matching the dynamic query.
187            *
188            * @param dynamicQuery the dynamic query
189            * @return the number of rows matching the dynamic query
190            */
191            public static long dynamicQueryCount(
192                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
193                    return getService().dynamicQueryCount(dynamicQuery);
194            }
195    
196            /**
197            * Returns the number of rows matching the dynamic query.
198            *
199            * @param dynamicQuery the dynamic query
200            * @param projection the projection to apply to the query
201            * @return the number of rows matching the dynamic query
202            */
203            public static long dynamicQueryCount(
204                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
205                    com.liferay.portal.kernel.dao.orm.Projection projection) {
206                    return getService().dynamicQueryCount(dynamicQuery, projection);
207            }
208    
209            public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchShoppingCoupon(
210                    long couponId) {
211                    return getService().fetchShoppingCoupon(couponId);
212            }
213    
214            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
215                    return getService().getActionableDynamicQuery();
216            }
217    
218            /**
219            * Returns the Spring bean ID for this bean.
220            *
221            * @return the Spring bean ID for this bean
222            */
223            public static java.lang.String getBeanIdentifier() {
224                    return getService().getBeanIdentifier();
225            }
226    
227            public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
228                    java.lang.String code)
229                    throws com.liferay.portal.kernel.exception.PortalException {
230                    return getService().getCoupon(code);
231            }
232    
233            public static com.liferay.portlet.shopping.model.ShoppingCoupon getCoupon(
234                    long couponId)
235                    throws com.liferay.portal.kernel.exception.PortalException {
236                    return getService().getCoupon(couponId);
237            }
238    
239            public static com.liferay.portal.model.PersistedModel getPersistedModel(
240                    java.io.Serializable primaryKeyObj)
241                    throws com.liferay.portal.kernel.exception.PortalException {
242                    return getService().getPersistedModel(primaryKeyObj);
243            }
244    
245            /**
246            * Returns the shopping coupon with the primary key.
247            *
248            * @param couponId the primary key of the shopping coupon
249            * @return the shopping coupon
250            * @throws PortalException if a shopping coupon with the primary key could not be found
251            */
252            public static com.liferay.portlet.shopping.model.ShoppingCoupon getShoppingCoupon(
253                    long couponId)
254                    throws com.liferay.portal.kernel.exception.PortalException {
255                    return getService().getShoppingCoupon(couponId);
256            }
257    
258            /**
259            * Returns a range of all the shopping coupons.
260            *
261            * <p>
262            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCouponModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
263            * </p>
264            *
265            * @param start the lower bound of the range of shopping coupons
266            * @param end the upper bound of the range of shopping coupons (not inclusive)
267            * @return the range of shopping coupons
268            */
269            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> getShoppingCoupons(
270                    int start, int end) {
271                    return getService().getShoppingCoupons(start, end);
272            }
273    
274            /**
275            * Returns the number of shopping coupons.
276            *
277            * @return the number of shopping coupons
278            */
279            public static int getShoppingCouponsCount() {
280                    return getService().getShoppingCouponsCount();
281            }
282    
283            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> search(
284                    long groupId, long companyId, java.lang.String code, boolean active,
285                    java.lang.String discountType, boolean andOperator, int start, int end) {
286                    return getService()
287                                       .search(groupId, companyId, code, active, discountType,
288                            andOperator, start, end);
289            }
290    
291            public static int searchCount(long groupId, long companyId,
292                    java.lang.String code, boolean active, java.lang.String discountType,
293                    boolean andOperator) {
294                    return getService()
295                                       .searchCount(groupId, companyId, code, active, discountType,
296                            andOperator);
297            }
298    
299            /**
300            * Sets the Spring bean ID for this bean.
301            *
302            * @param beanIdentifier the Spring bean ID for this bean
303            */
304            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
305                    getService().setBeanIdentifier(beanIdentifier);
306            }
307    
308            public static com.liferay.portlet.shopping.model.ShoppingCoupon updateCoupon(
309                    long userId, long couponId, java.lang.String name,
310                    java.lang.String description, int startDateMonth, int startDateDay,
311                    int startDateYear, int startDateHour, int startDateMinute,
312                    int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
313                    int endDateMinute, boolean neverExpire, boolean active,
314                    java.lang.String limitCategories, java.lang.String limitSkus,
315                    double minOrder, double discount, java.lang.String discountType,
316                    com.liferay.portal.service.ServiceContext serviceContext)
317                    throws com.liferay.portal.kernel.exception.PortalException {
318                    return getService()
319                                       .updateCoupon(userId, couponId, name, description,
320                            startDateMonth, startDateDay, startDateYear, startDateHour,
321                            startDateMinute, endDateMonth, endDateDay, endDateYear,
322                            endDateHour, endDateMinute, neverExpire, active, limitCategories,
323                            limitSkus, minOrder, discount, discountType, serviceContext);
324            }
325    
326            /**
327            * Updates the shopping coupon in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
328            *
329            * @param shoppingCoupon the shopping coupon
330            * @return the shopping coupon that was updated
331            */
332            public static com.liferay.portlet.shopping.model.ShoppingCoupon updateShoppingCoupon(
333                    com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon) {
334                    return getService().updateShoppingCoupon(shoppingCoupon);
335            }
336    
337            public static ShoppingCouponLocalService getService() {
338                    if (_service == null) {
339                            _service = (ShoppingCouponLocalService)PortalBeanLocatorUtil.locate(ShoppingCouponLocalService.class.getName());
340    
341                            ReferenceRegistry.registerReference(ShoppingCouponLocalServiceUtil.class,
342                                    "_service");
343                    }
344    
345                    return _service;
346            }
347    
348            /**
349             * @deprecated As of 6.2.0
350             */
351            @Deprecated
352            public void setService(ShoppingCouponLocalService service) {
353            }
354    
355            private static ShoppingCouponLocalService _service;
356    }