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.portal.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 Phone. This utility wraps
024     * {@link com.liferay.portal.service.impl.PhoneLocalServiceImpl} 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 PhoneLocalService
032     * @see com.liferay.portal.service.base.PhoneLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.PhoneLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class PhoneLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PhoneLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the phone to the database. Also notifies the appropriate model listeners.
046            *
047            * @param phone the phone
048            * @return the phone that was added
049            */
050            public static com.liferay.portal.model.Phone addPhone(
051                    com.liferay.portal.model.Phone phone) {
052                    return getService().addPhone(phone);
053            }
054    
055            /**
056            * @deprecated As of 6.2.0, replaced by {@link #addPhone(long, String, long,
057            String, String, int, boolean, ServiceContext)}
058            */
059            @Deprecated
060            public static com.liferay.portal.model.Phone addPhone(long userId,
061                    java.lang.String className, long classPK, java.lang.String number,
062                    java.lang.String extension, int typeId, boolean primary)
063                    throws com.liferay.portal.kernel.exception.PortalException {
064                    return getService()
065                                       .addPhone(userId, className, classPK, number, extension,
066                            typeId, primary);
067            }
068    
069            public static com.liferay.portal.model.Phone addPhone(long userId,
070                    java.lang.String className, long classPK, java.lang.String number,
071                    java.lang.String extension, int typeId, boolean primary,
072                    com.liferay.portal.service.ServiceContext serviceContext)
073                    throws com.liferay.portal.kernel.exception.PortalException {
074                    return getService()
075                                       .addPhone(userId, className, classPK, number, extension,
076                            typeId, primary, serviceContext);
077            }
078    
079            /**
080            * Creates a new phone with the primary key. Does not add the phone to the database.
081            *
082            * @param phoneId the primary key for the new phone
083            * @return the new phone
084            */
085            public static com.liferay.portal.model.Phone createPhone(long phoneId) {
086                    return getService().createPhone(phoneId);
087            }
088    
089            /**
090            * @throws PortalException
091            */
092            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
093                    com.liferay.portal.model.PersistedModel persistedModel)
094                    throws com.liferay.portal.kernel.exception.PortalException {
095                    return getService().deletePersistedModel(persistedModel);
096            }
097    
098            /**
099            * Deletes the phone from the database. Also notifies the appropriate model listeners.
100            *
101            * @param phone the phone
102            * @return the phone that was removed
103            */
104            public static com.liferay.portal.model.Phone deletePhone(
105                    com.liferay.portal.model.Phone phone) {
106                    return getService().deletePhone(phone);
107            }
108    
109            /**
110            * Deletes the phone with the primary key from the database. Also notifies the appropriate model listeners.
111            *
112            * @param phoneId the primary key of the phone
113            * @return the phone that was removed
114            * @throws PortalException if a phone with the primary key could not be found
115            */
116            public static com.liferay.portal.model.Phone deletePhone(long phoneId)
117                    throws com.liferay.portal.kernel.exception.PortalException {
118                    return getService().deletePhone(phoneId);
119            }
120    
121            public static void deletePhones(long companyId, java.lang.String className,
122                    long classPK) {
123                    getService().deletePhones(companyId, className, classPK);
124            }
125    
126            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
127                    return getService().dynamicQuery();
128            }
129    
130            /**
131            * Performs a dynamic query on the database and returns the matching rows.
132            *
133            * @param dynamicQuery the dynamic query
134            * @return the matching rows
135            */
136            public static <T> java.util.List<T> dynamicQuery(
137                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
138                    return getService().dynamicQuery(dynamicQuery);
139            }
140    
141            /**
142            * Performs a dynamic query on the database and returns a range of the matching rows.
143            *
144            * <p>
145            * 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.portal.model.impl.PhoneModelImpl}. 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.
146            * </p>
147            *
148            * @param dynamicQuery the dynamic query
149            * @param start the lower bound of the range of model instances
150            * @param end the upper bound of the range of model instances (not inclusive)
151            * @return the range of matching rows
152            */
153            public static <T> java.util.List<T> dynamicQuery(
154                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
155                    int end) {
156                    return getService().dynamicQuery(dynamicQuery, start, end);
157            }
158    
159            /**
160            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
161            *
162            * <p>
163            * 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.portal.model.impl.PhoneModelImpl}. 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.
164            * </p>
165            *
166            * @param dynamicQuery the dynamic query
167            * @param start the lower bound of the range of model instances
168            * @param end the upper bound of the range of model instances (not inclusive)
169            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
170            * @return the ordered range of matching rows
171            */
172            public static <T> java.util.List<T> dynamicQuery(
173                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
174                    int end,
175                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
176                    return getService()
177                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
178            }
179    
180            /**
181            * Returns the number of rows matching the dynamic query.
182            *
183            * @param dynamicQuery the dynamic query
184            * @return the number of rows matching the dynamic query
185            */
186            public static long dynamicQueryCount(
187                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
188                    return getService().dynamicQueryCount(dynamicQuery);
189            }
190    
191            /**
192            * Returns the number of rows matching the dynamic query.
193            *
194            * @param dynamicQuery the dynamic query
195            * @param projection the projection to apply to the query
196            * @return the number of rows matching the dynamic query
197            */
198            public static long dynamicQueryCount(
199                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
200                    com.liferay.portal.kernel.dao.orm.Projection projection) {
201                    return getService().dynamicQueryCount(dynamicQuery, projection);
202            }
203    
204            public static com.liferay.portal.model.Phone fetchPhone(long phoneId) {
205                    return getService().fetchPhone(phoneId);
206            }
207    
208            /**
209            * Returns the phone with the matching UUID and company.
210            *
211            * @param uuid the phone's UUID
212            * @param companyId the primary key of the company
213            * @return the matching phone, or <code>null</code> if a matching phone could not be found
214            */
215            public static com.liferay.portal.model.Phone fetchPhoneByUuidAndCompanyId(
216                    java.lang.String uuid, long companyId) {
217                    return getService().fetchPhoneByUuidAndCompanyId(uuid, companyId);
218            }
219    
220            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
221                    return getService().getActionableDynamicQuery();
222            }
223    
224            /**
225            * Returns the Spring bean ID for this bean.
226            *
227            * @return the Spring bean ID for this bean
228            */
229            public static java.lang.String getBeanIdentifier() {
230                    return getService().getBeanIdentifier();
231            }
232    
233            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
234                    com.liferay.portal.kernel.lar.PortletDataContext portletDataContext) {
235                    return getService().getExportActionableDynamicQuery(portletDataContext);
236            }
237    
238            public static com.liferay.portal.model.PersistedModel getPersistedModel(
239                    java.io.Serializable primaryKeyObj)
240                    throws com.liferay.portal.kernel.exception.PortalException {
241                    return getService().getPersistedModel(primaryKeyObj);
242            }
243    
244            /**
245            * Returns the phone with the primary key.
246            *
247            * @param phoneId the primary key of the phone
248            * @return the phone
249            * @throws PortalException if a phone with the primary key could not be found
250            */
251            public static com.liferay.portal.model.Phone getPhone(long phoneId)
252                    throws com.liferay.portal.kernel.exception.PortalException {
253                    return getService().getPhone(phoneId);
254            }
255    
256            /**
257            * Returns the phone with the matching UUID and company.
258            *
259            * @param uuid the phone's UUID
260            * @param companyId the primary key of the company
261            * @return the matching phone
262            * @throws PortalException if a matching phone could not be found
263            */
264            public static com.liferay.portal.model.Phone getPhoneByUuidAndCompanyId(
265                    java.lang.String uuid, long companyId)
266                    throws com.liferay.portal.kernel.exception.PortalException {
267                    return getService().getPhoneByUuidAndCompanyId(uuid, companyId);
268            }
269    
270            public static java.util.List<com.liferay.portal.model.Phone> getPhones() {
271                    return getService().getPhones();
272            }
273    
274            public static java.util.List<com.liferay.portal.model.Phone> getPhones(
275                    long companyId, java.lang.String className, long classPK) {
276                    return getService().getPhones(companyId, className, classPK);
277            }
278    
279            /**
280            * Returns a range of all the phones.
281            *
282            * <p>
283            * 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.portal.model.impl.PhoneModelImpl}. 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.
284            * </p>
285            *
286            * @param start the lower bound of the range of phones
287            * @param end the upper bound of the range of phones (not inclusive)
288            * @return the range of phones
289            */
290            public static java.util.List<com.liferay.portal.model.Phone> getPhones(
291                    int start, int end) {
292                    return getService().getPhones(start, end);
293            }
294    
295            /**
296            * Returns the number of phones.
297            *
298            * @return the number of phones
299            */
300            public static int getPhonesCount() {
301                    return getService().getPhonesCount();
302            }
303    
304            /**
305            * Sets the Spring bean ID for this bean.
306            *
307            * @param beanIdentifier the Spring bean ID for this bean
308            */
309            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
310                    getService().setBeanIdentifier(beanIdentifier);
311            }
312    
313            /**
314            * Updates the phone in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
315            *
316            * @param phone the phone
317            * @return the phone that was updated
318            */
319            public static com.liferay.portal.model.Phone updatePhone(
320                    com.liferay.portal.model.Phone phone) {
321                    return getService().updatePhone(phone);
322            }
323    
324            public static com.liferay.portal.model.Phone updatePhone(long phoneId,
325                    java.lang.String number, java.lang.String extension, int typeId,
326                    boolean primary)
327                    throws com.liferay.portal.kernel.exception.PortalException {
328                    return getService()
329                                       .updatePhone(phoneId, number, extension, typeId, primary);
330            }
331    
332            public static PhoneLocalService getService() {
333                    if (_service == null) {
334                            _service = (PhoneLocalService)PortalBeanLocatorUtil.locate(PhoneLocalService.class.getName());
335    
336                            ReferenceRegistry.registerReference(PhoneLocalServiceUtil.class,
337                                    "_service");
338                    }
339    
340                    return _service;
341            }
342    
343            /**
344             * @deprecated As of 6.2.0
345             */
346            @Deprecated
347            public void setService(PhoneLocalService service) {
348            }
349    
350            private static PhoneLocalService _service;
351    }