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, long 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, long 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 public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery( 225 com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) { 226 return getService().getExportActionableDynamicQuery(portletDataContext); 227 } 228 229 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 230 return getService().getIndexableActionableDynamicQuery(); 231 } 232 233 /** 234 * Returns the OSGi service identifier. 235 * 236 * @return the OSGi service identifier 237 */ 238 public static java.lang.String getOSGiServiceIdentifier() { 239 return getService().getOSGiServiceIdentifier(); 240 } 241 242 public static com.liferay.portal.model.PersistedModel getPersistedModel( 243 java.io.Serializable primaryKeyObj) 244 throws com.liferay.portal.kernel.exception.PortalException { 245 return getService().getPersistedModel(primaryKeyObj); 246 } 247 248 /** 249 * Returns the phone with the primary key. 250 * 251 * @param phoneId the primary key of the phone 252 * @return the phone 253 * @throws PortalException if a phone with the primary key could not be found 254 */ 255 public static com.liferay.portal.model.Phone getPhone(long phoneId) 256 throws com.liferay.portal.kernel.exception.PortalException { 257 return getService().getPhone(phoneId); 258 } 259 260 /** 261 * Returns the phone with the matching UUID and company. 262 * 263 * @param uuid the phone's UUID 264 * @param companyId the primary key of the company 265 * @return the matching phone 266 * @throws PortalException if a matching phone could not be found 267 */ 268 public static com.liferay.portal.model.Phone getPhoneByUuidAndCompanyId( 269 java.lang.String uuid, long companyId) 270 throws com.liferay.portal.kernel.exception.PortalException { 271 return getService().getPhoneByUuidAndCompanyId(uuid, companyId); 272 } 273 274 public static java.util.List<com.liferay.portal.model.Phone> getPhones() { 275 return getService().getPhones(); 276 } 277 278 public static java.util.List<com.liferay.portal.model.Phone> getPhones( 279 long companyId, java.lang.String className, long classPK) { 280 return getService().getPhones(companyId, className, classPK); 281 } 282 283 /** 284 * Returns a range of all the phones. 285 * 286 * <p> 287 * 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. 288 * </p> 289 * 290 * @param start the lower bound of the range of phones 291 * @param end the upper bound of the range of phones (not inclusive) 292 * @return the range of phones 293 */ 294 public static java.util.List<com.liferay.portal.model.Phone> getPhones( 295 int start, int end) { 296 return getService().getPhones(start, end); 297 } 298 299 /** 300 * Returns the number of phones. 301 * 302 * @return the number of phones 303 */ 304 public static int getPhonesCount() { 305 return getService().getPhonesCount(); 306 } 307 308 /** 309 * Updates the phone in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 310 * 311 * @param phone the phone 312 * @return the phone that was updated 313 */ 314 public static com.liferay.portal.model.Phone updatePhone( 315 com.liferay.portal.model.Phone phone) { 316 return getService().updatePhone(phone); 317 } 318 319 public static com.liferay.portal.model.Phone updatePhone(long phoneId, 320 java.lang.String number, java.lang.String extension, long typeId, 321 boolean primary) 322 throws com.liferay.portal.kernel.exception.PortalException { 323 return getService() 324 .updatePhone(phoneId, number, extension, typeId, primary); 325 } 326 327 public static PhoneLocalService getService() { 328 if (_service == null) { 329 _service = (PhoneLocalService)PortalBeanLocatorUtil.locate(PhoneLocalService.class.getName()); 330 331 ReferenceRegistry.registerReference(PhoneLocalServiceUtil.class, 332 "_service"); 333 } 334 335 return _service; 336 } 337 338 private static PhoneLocalService _service; 339 }