001    /**
002     * Copyright (c) 2000-2010 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 com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * The utility for the phone local service. This utility wraps {@link com.liferay.portal.service.impl.PhoneLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
021     *
022     * <p>
023     * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PhoneLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
024     * </p>
025     *
026     * <p>
027     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
028     * </p>
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    public class PhoneLocalServiceUtil {
037            /**
038            * Adds the phone to the database. Also notifies the appropriate model listeners.
039            *
040            * @param phone the phone to add
041            * @return the phone that was added
042            * @throws SystemException if a system exception occurred
043            */
044            public static com.liferay.portal.model.Phone addPhone(
045                    com.liferay.portal.model.Phone phone)
046                    throws com.liferay.portal.kernel.exception.SystemException {
047                    return getService().addPhone(phone);
048            }
049    
050            /**
051            * Creates a new phone with the primary key. Does not add the phone to the database.
052            *
053            * @param phoneId the primary key for the new phone
054            * @return the new phone
055            */
056            public static com.liferay.portal.model.Phone createPhone(long phoneId) {
057                    return getService().createPhone(phoneId);
058            }
059    
060            /**
061            * Deletes the phone with the primary key from the database. Also notifies the appropriate model listeners.
062            *
063            * @param phoneId the primary key of the phone to delete
064            * @throws PortalException if a phone with the primary key could not be found
065            * @throws SystemException if a system exception occurred
066            */
067            public static void deletePhone(long phoneId)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    getService().deletePhone(phoneId);
071            }
072    
073            /**
074            * Deletes the phone from the database. Also notifies the appropriate model listeners.
075            *
076            * @param phone the phone to delete
077            * @throws SystemException if a system exception occurred
078            */
079            public static void deletePhone(com.liferay.portal.model.Phone phone)
080                    throws com.liferay.portal.kernel.exception.SystemException {
081                    getService().deletePhone(phone);
082            }
083    
084            /**
085            * Performs a dynamic query on the database and returns the matching rows.
086            *
087            * @param dynamicQuery the dynamic query to search with
088            * @return the matching rows
089            * @throws SystemException if a system exception occurred
090            */
091            @SuppressWarnings("rawtypes")
092            public static java.util.List dynamicQuery(
093                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
094                    throws com.liferay.portal.kernel.exception.SystemException {
095                    return getService().dynamicQuery(dynamicQuery);
096            }
097    
098            /**
099            * Performs a dynamic query on the database and returns a range of the matching rows.
100            *
101            * <p>
102            * 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.
103            * </p>
104            *
105            * @param dynamicQuery the dynamic query to search with
106            * @param start the lower bound of the range of model instances to return
107            * @param end the upper bound of the range of model instances to return (not inclusive)
108            * @return the range of matching rows
109            * @throws SystemException if a system exception occurred
110            */
111            @SuppressWarnings("rawtypes")
112            public static java.util.List dynamicQuery(
113                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
114                    int end) throws com.liferay.portal.kernel.exception.SystemException {
115                    return getService().dynamicQuery(dynamicQuery, start, end);
116            }
117    
118            /**
119            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
120            *
121            * <p>
122            * 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.
123            * </p>
124            *
125            * @param dynamicQuery the dynamic query to search with
126            * @param start the lower bound of the range of model instances to return
127            * @param end the upper bound of the range of model instances to return (not inclusive)
128            * @param orderByComparator the comparator to order the results by
129            * @return the ordered range of matching rows
130            * @throws SystemException if a system exception occurred
131            */
132            @SuppressWarnings("rawtypes")
133            public static java.util.List dynamicQuery(
134                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
135                    int end,
136                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
137                    throws com.liferay.portal.kernel.exception.SystemException {
138                    return getService()
139                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
140            }
141    
142            /**
143            * Counts the number of rows that match the dynamic query.
144            *
145            * @param dynamicQuery the dynamic query to search with
146            * @return the number of rows that match the dynamic query
147            * @throws SystemException if a system exception occurred
148            */
149            public static long dynamicQueryCount(
150                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
151                    throws com.liferay.portal.kernel.exception.SystemException {
152                    return getService().dynamicQueryCount(dynamicQuery);
153            }
154    
155            /**
156            * Gets the phone with the primary key.
157            *
158            * @param phoneId the primary key of the phone to get
159            * @return the phone
160            * @throws PortalException if a phone with the primary key could not be found
161            * @throws SystemException if a system exception occurred
162            */
163            public static com.liferay.portal.model.Phone getPhone(long phoneId)
164                    throws com.liferay.portal.kernel.exception.PortalException,
165                            com.liferay.portal.kernel.exception.SystemException {
166                    return getService().getPhone(phoneId);
167            }
168    
169            /**
170            * Gets a range of all the phones.
171            *
172            * <p>
173            * 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.
174            * </p>
175            *
176            * @param start the lower bound of the range of phones to return
177            * @param end the upper bound of the range of phones to return (not inclusive)
178            * @return the range of phones
179            * @throws SystemException if a system exception occurred
180            */
181            public static java.util.List<com.liferay.portal.model.Phone> getPhones(
182                    int start, int end)
183                    throws com.liferay.portal.kernel.exception.SystemException {
184                    return getService().getPhones(start, end);
185            }
186    
187            /**
188            * Gets the number of phones.
189            *
190            * @return the number of phones
191            * @throws SystemException if a system exception occurred
192            */
193            public static int getPhonesCount()
194                    throws com.liferay.portal.kernel.exception.SystemException {
195                    return getService().getPhonesCount();
196            }
197    
198            /**
199            * Updates the phone in the database. Also notifies the appropriate model listeners.
200            *
201            * @param phone the phone to update
202            * @return the phone that was updated
203            * @throws SystemException if a system exception occurred
204            */
205            public static com.liferay.portal.model.Phone updatePhone(
206                    com.liferay.portal.model.Phone phone)
207                    throws com.liferay.portal.kernel.exception.SystemException {
208                    return getService().updatePhone(phone);
209            }
210    
211            /**
212            * Updates the phone in the database. Also notifies the appropriate model listeners.
213            *
214            * @param phone the phone to update
215            * @param merge whether to merge the phone with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
216            * @return the phone that was updated
217            * @throws SystemException if a system exception occurred
218            */
219            public static com.liferay.portal.model.Phone updatePhone(
220                    com.liferay.portal.model.Phone phone, boolean merge)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getService().updatePhone(phone, merge);
223            }
224    
225            public static com.liferay.portal.model.Phone addPhone(long userId,
226                    java.lang.String className, long classPK, java.lang.String number,
227                    java.lang.String extension, int typeId, boolean primary)
228                    throws com.liferay.portal.kernel.exception.PortalException,
229                            com.liferay.portal.kernel.exception.SystemException {
230                    return getService()
231                                       .addPhone(userId, className, classPK, number, extension,
232                            typeId, primary);
233            }
234    
235            public static void deletePhones(long companyId, java.lang.String className,
236                    long classPK)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    getService().deletePhones(companyId, className, classPK);
239            }
240    
241            public static java.util.List<com.liferay.portal.model.Phone> getPhones()
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getService().getPhones();
244            }
245    
246            public static java.util.List<com.liferay.portal.model.Phone> getPhones(
247                    long companyId, java.lang.String className, long classPK)
248                    throws com.liferay.portal.kernel.exception.SystemException {
249                    return getService().getPhones(companyId, className, classPK);
250            }
251    
252            public static com.liferay.portal.model.Phone updatePhone(long phoneId,
253                    java.lang.String number, java.lang.String extension, int typeId,
254                    boolean primary)
255                    throws com.liferay.portal.kernel.exception.PortalException,
256                            com.liferay.portal.kernel.exception.SystemException {
257                    return getService()
258                                       .updatePhone(phoneId, number, extension, typeId, primary);
259            }
260    
261            public static PhoneLocalService getService() {
262                    if (_service == null) {
263                            _service = (PhoneLocalService)PortalBeanLocatorUtil.locate(PhoneLocalService.class.getName());
264                    }
265    
266                    return _service;
267            }
268    
269            public void setService(PhoneLocalService service) {
270                    _service = service;
271            }
272    
273            private static PhoneLocalService _service;
274    }