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