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