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