Database.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <?php
  2. namespace PhpOffice\PhpSpreadsheet\Calculation;
  3. /**
  4. * @deprecated 1.17.0
  5. */
  6. class Database
  7. {
  8. /**
  9. * DAVERAGE.
  10. *
  11. * Averages the values in a column of a list or database that match conditions you specify.
  12. *
  13. * Excel Function:
  14. * DAVERAGE(database,field,criteria)
  15. *
  16. * @Deprecated 1.17.0
  17. *
  18. * @see Database\DAverage::evaluate()
  19. * Use the evaluate() method in the Database\DAverage class instead
  20. *
  21. * @param mixed[] $database The range of cells that makes up the list or database.
  22. * A database is a list of related data in which rows of related
  23. * information are records, and columns of data are fields. The
  24. * first row of the list contains labels for each column.
  25. * @param int|string $field Indicates which column is used in the function. Enter the
  26. * column label enclosed between double quotation marks, such as
  27. * "Age" or "Yield," or a number (without quotation marks) that
  28. * represents the position of the column within the list: 1 for
  29. * the first column, 2 for the second column, and so on.
  30. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  31. * You can use any range for the criteria argument, as long as it
  32. * includes at least one column label and at least one cell below
  33. * the column label in which you specify a condition for the
  34. * column.
  35. *
  36. * @return null|float|string
  37. */
  38. public static function DAVERAGE($database, $field, $criteria)
  39. {
  40. return Database\DAverage::evaluate($database, $field, $criteria);
  41. }
  42. /**
  43. * DCOUNT.
  44. *
  45. * Counts the cells that contain numbers in a column of a list or database that match conditions
  46. * that you specify.
  47. *
  48. * Excel Function:
  49. * DCOUNT(database,[field],criteria)
  50. *
  51. * @Deprecated 1.17.0
  52. *
  53. * @see Database\DCount::evaluate()
  54. * Use the evaluate() method in the Database\DCount class instead
  55. *
  56. * @param mixed[] $database The range of cells that makes up the list or database.
  57. * A database is a list of related data in which rows of related
  58. * information are records, and columns of data are fields. The
  59. * first row of the list contains labels for each column.
  60. * @param null|int|string $field Indicates which column is used in the function. Enter the
  61. * column label enclosed between double quotation marks, such as
  62. * "Age" or "Yield," or a number (without quotation marks) that
  63. * represents the position of the column within the list: 1 for
  64. * the first column, 2 for the second column, and so on.
  65. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  66. * You can use any range for the criteria argument, as long as it
  67. * includes at least one column label and at least one cell below
  68. * the column label in which you specify a condition for the
  69. * column.
  70. *
  71. * @return int
  72. *
  73. * @TODO The field argument is optional. If field is omitted, DCOUNT counts all records in the
  74. * database that match the criteria.
  75. */
  76. public static function DCOUNT($database, $field, $criteria)
  77. {
  78. return Database\DCount::evaluate($database, $field, $criteria);
  79. }
  80. /**
  81. * DCOUNTA.
  82. *
  83. * Counts the nonblank cells in a column of a list or database that match conditions that you specify.
  84. *
  85. * Excel Function:
  86. * DCOUNTA(database,[field],criteria)
  87. *
  88. * @Deprecated 1.17.0
  89. *
  90. * @see Database\DCountA::evaluate()
  91. * Use the evaluate() method in the Database\DCountA class instead
  92. *
  93. * @param mixed[] $database The range of cells that makes up the list or database.
  94. * A database is a list of related data in which rows of related
  95. * information are records, and columns of data are fields. The
  96. * first row of the list contains labels for each column.
  97. * @param null|int|string $field Indicates which column is used in the function. Enter the
  98. * column label enclosed between double quotation marks, such as
  99. * "Age" or "Yield," or a number (without quotation marks) that
  100. * represents the position of the column within the list: 1 for
  101. * the first column, 2 for the second column, and so on.
  102. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  103. * You can use any range for the criteria argument, as long as it
  104. * includes at least one column label and at least one cell below
  105. * the column label in which you specify a condition for the
  106. * column.
  107. *
  108. * @return int
  109. */
  110. public static function DCOUNTA($database, $field, $criteria)
  111. {
  112. return Database\DCountA::evaluate($database, $field, $criteria);
  113. }
  114. /**
  115. * DGET.
  116. *
  117. * Extracts a single value from a column of a list or database that matches conditions that you
  118. * specify.
  119. *
  120. * Excel Function:
  121. * DGET(database,field,criteria)
  122. *
  123. * @Deprecated 1.17.0
  124. *
  125. * @see Database\DGet::evaluate()
  126. * Use the evaluate() method in the Database\DGet class instead
  127. *
  128. * @param mixed[] $database The range of cells that makes up the list or database.
  129. * A database is a list of related data in which rows of related
  130. * information are records, and columns of data are fields. The
  131. * first row of the list contains labels for each column.
  132. * @param int|string $field Indicates which column is used in the function. Enter the
  133. * column label enclosed between double quotation marks, such as
  134. * "Age" or "Yield," or a number (without quotation marks) that
  135. * represents the position of the column within the list: 1 for
  136. * the first column, 2 for the second column, and so on.
  137. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  138. * You can use any range for the criteria argument, as long as it
  139. * includes at least one column label and at least one cell below
  140. * the column label in which you specify a condition for the
  141. * column.
  142. *
  143. * @return mixed
  144. */
  145. public static function DGET($database, $field, $criteria)
  146. {
  147. return Database\DGet::evaluate($database, $field, $criteria);
  148. }
  149. /**
  150. * DMAX.
  151. *
  152. * Returns the largest number in a column of a list or database that matches conditions you that
  153. * specify.
  154. *
  155. * Excel Function:
  156. * DMAX(database,field,criteria)
  157. *
  158. * @Deprecated 1.17.0
  159. *
  160. * @see Database\DMax::evaluate()
  161. * Use the evaluate() method in the Database\DMax class instead
  162. *
  163. * @param mixed[] $database The range of cells that makes up the list or database.
  164. * A database is a list of related data in which rows of related
  165. * information are records, and columns of data are fields. The
  166. * first row of the list contains labels for each column.
  167. * @param int|string $field Indicates which column is used in the function. Enter the
  168. * column label enclosed between double quotation marks, such as
  169. * "Age" or "Yield," or a number (without quotation marks) that
  170. * represents the position of the column within the list: 1 for
  171. * the first column, 2 for the second column, and so on.
  172. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  173. * You can use any range for the criteria argument, as long as it
  174. * includes at least one column label and at least one cell below
  175. * the column label in which you specify a condition for the
  176. * column.
  177. *
  178. * @return float
  179. */
  180. public static function DMAX($database, $field, $criteria)
  181. {
  182. return Database\DMax::evaluate($database, $field, $criteria);
  183. }
  184. /**
  185. * DMIN.
  186. *
  187. * Returns the smallest number in a column of a list or database that matches conditions you that
  188. * specify.
  189. *
  190. * Excel Function:
  191. * DMIN(database,field,criteria)
  192. *
  193. * @Deprecated 1.17.0
  194. *
  195. * @see Database\DMin::evaluate()
  196. * Use the evaluate() method in the Database\DMin class instead
  197. *
  198. * @param mixed[] $database The range of cells that makes up the list or database.
  199. * A database is a list of related data in which rows of related
  200. * information are records, and columns of data are fields. The
  201. * first row of the list contains labels for each column.
  202. * @param int|string $field Indicates which column is used in the function. Enter the
  203. * column label enclosed between double quotation marks, such as
  204. * "Age" or "Yield," or a number (without quotation marks) that
  205. * represents the position of the column within the list: 1 for
  206. * the first column, 2 for the second column, and so on.
  207. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  208. * You can use any range for the criteria argument, as long as it
  209. * includes at least one column label and at least one cell below
  210. * the column label in which you specify a condition for the
  211. * column.
  212. *
  213. * @return float
  214. */
  215. public static function DMIN($database, $field, $criteria)
  216. {
  217. return Database\DMin::evaluate($database, $field, $criteria);
  218. }
  219. /**
  220. * DPRODUCT.
  221. *
  222. * Multiplies the values in a column of a list or database that match conditions that you specify.
  223. *
  224. * Excel Function:
  225. * DPRODUCT(database,field,criteria)
  226. *
  227. * @Deprecated 1.17.0
  228. *
  229. * @see Database\DProduct::evaluate()
  230. * Use the evaluate() method in the Database\DProduct class instead
  231. *
  232. * @param mixed[] $database The range of cells that makes up the list or database.
  233. * A database is a list of related data in which rows of related
  234. * information are records, and columns of data are fields. The
  235. * first row of the list contains labels for each column.
  236. * @param int|string $field Indicates which column is used in the function. Enter the
  237. * column label enclosed between double quotation marks, such as
  238. * "Age" or "Yield," or a number (without quotation marks) that
  239. * represents the position of the column within the list: 1 for
  240. * the first column, 2 for the second column, and so on.
  241. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  242. * You can use any range for the criteria argument, as long as it
  243. * includes at least one column label and at least one cell below
  244. * the column label in which you specify a condition for the
  245. * column.
  246. *
  247. * @return float|string
  248. */
  249. public static function DPRODUCT($database, $field, $criteria)
  250. {
  251. return Database\DProduct::evaluate($database, $field, $criteria);
  252. }
  253. /**
  254. * DSTDEV.
  255. *
  256. * Estimates the standard deviation of a population based on a sample by using the numbers in a
  257. * column of a list or database that match conditions that you specify.
  258. *
  259. * Excel Function:
  260. * DSTDEV(database,field,criteria)
  261. *
  262. * @Deprecated 1.17.0
  263. *
  264. * @see Database\DStDev::evaluate()
  265. * Use the evaluate() method in the Database\DStDev class instead
  266. *
  267. * @param mixed[] $database The range of cells that makes up the list or database.
  268. * A database is a list of related data in which rows of related
  269. * information are records, and columns of data are fields. The
  270. * first row of the list contains labels for each column.
  271. * @param int|string $field Indicates which column is used in the function. Enter the
  272. * column label enclosed between double quotation marks, such as
  273. * "Age" or "Yield," or a number (without quotation marks) that
  274. * represents the position of the column within the list: 1 for
  275. * the first column, 2 for the second column, and so on.
  276. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  277. * You can use any range for the criteria argument, as long as it
  278. * includes at least one column label and at least one cell below
  279. * the column label in which you specify a condition for the
  280. * column.
  281. *
  282. * @return float|string
  283. */
  284. public static function DSTDEV($database, $field, $criteria)
  285. {
  286. return Database\DStDev::evaluate($database, $field, $criteria);
  287. }
  288. /**
  289. * DSTDEVP.
  290. *
  291. * Calculates the standard deviation of a population based on the entire population by using the
  292. * numbers in a column of a list or database that match conditions that you specify.
  293. *
  294. * Excel Function:
  295. * DSTDEVP(database,field,criteria)
  296. *
  297. * @Deprecated 1.17.0
  298. *
  299. * @see Database\DStDevP::evaluate()
  300. * Use the evaluate() method in the Database\DStDevP class instead
  301. *
  302. * @param mixed[] $database The range of cells that makes up the list or database.
  303. * A database is a list of related data in which rows of related
  304. * information are records, and columns of data are fields. The
  305. * first row of the list contains labels for each column.
  306. * @param int|string $field Indicates which column is used in the function. Enter the
  307. * column label enclosed between double quotation marks, such as
  308. * "Age" or "Yield," or a number (without quotation marks) that
  309. * represents the position of the column within the list: 1 for
  310. * the first column, 2 for the second column, and so on.
  311. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  312. * You can use any range for the criteria argument, as long as it
  313. * includes at least one column label and at least one cell below
  314. * the column label in which you specify a condition for the
  315. * column.
  316. *
  317. * @return float|string
  318. */
  319. public static function DSTDEVP($database, $field, $criteria)
  320. {
  321. return Database\DStDevP::evaluate($database, $field, $criteria);
  322. }
  323. /**
  324. * DSUM.
  325. *
  326. * Adds the numbers in a column of a list or database that match conditions that you specify.
  327. *
  328. * Excel Function:
  329. * DSUM(database,field,criteria)
  330. *
  331. * @Deprecated 1.17.0
  332. *
  333. * @see Database\DSum::evaluate()
  334. * Use the evaluate() method in the Database\DSum class instead
  335. *
  336. * @param mixed[] $database The range of cells that makes up the list or database.
  337. * A database is a list of related data in which rows of related
  338. * information are records, and columns of data are fields. The
  339. * first row of the list contains labels for each column.
  340. * @param int|string $field Indicates which column is used in the function. Enter the
  341. * column label enclosed between double quotation marks, such as
  342. * "Age" or "Yield," or a number (without quotation marks) that
  343. * represents the position of the column within the list: 1 for
  344. * the first column, 2 for the second column, and so on.
  345. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  346. * You can use any range for the criteria argument, as long as it
  347. * includes at least one column label and at least one cell below
  348. * the column label in which you specify a condition for the
  349. * column.
  350. *
  351. * @return float|string
  352. */
  353. public static function DSUM($database, $field, $criteria)
  354. {
  355. return Database\DSum::evaluate($database, $field, $criteria);
  356. }
  357. /**
  358. * DVAR.
  359. *
  360. * Estimates the variance of a population based on a sample by using the numbers in a column
  361. * of a list or database that match conditions that you specify.
  362. *
  363. * Excel Function:
  364. * DVAR(database,field,criteria)
  365. *
  366. * @Deprecated 1.17.0
  367. *
  368. * @see Database\DVar::evaluate()
  369. * Use the evaluate() method in the Database\DVar class instead
  370. *
  371. * @param mixed[] $database The range of cells that makes up the list or database.
  372. * A database is a list of related data in which rows of related
  373. * information are records, and columns of data are fields. The
  374. * first row of the list contains labels for each column.
  375. * @param int|string $field Indicates which column is used in the function. Enter the
  376. * column label enclosed between double quotation marks, such as
  377. * "Age" or "Yield," or a number (without quotation marks) that
  378. * represents the position of the column within the list: 1 for
  379. * the first column, 2 for the second column, and so on.
  380. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  381. * You can use any range for the criteria argument, as long as it
  382. * includes at least one column label and at least one cell below
  383. * the column label in which you specify a condition for the
  384. * column.
  385. *
  386. * @return float|string (string if result is an error)
  387. */
  388. public static function DVAR($database, $field, $criteria)
  389. {
  390. return Database\DVar::evaluate($database, $field, $criteria);
  391. }
  392. /**
  393. * DVARP.
  394. *
  395. * Calculates the variance of a population based on the entire population by using the numbers
  396. * in a column of a list or database that match conditions that you specify.
  397. *
  398. * Excel Function:
  399. * DVARP(database,field,criteria)
  400. *
  401. * @Deprecated 1.17.0
  402. *
  403. * @see Database\DVarP::evaluate()
  404. * Use the evaluate() method in the Database\DVarP class instead
  405. *
  406. * @param mixed[] $database The range of cells that makes up the list or database.
  407. * A database is a list of related data in which rows of related
  408. * information are records, and columns of data are fields. The
  409. * first row of the list contains labels for each column.
  410. * @param int|string $field Indicates which column is used in the function. Enter the
  411. * column label enclosed between double quotation marks, such as
  412. * "Age" or "Yield," or a number (without quotation marks) that
  413. * represents the position of the column within the list: 1 for
  414. * the first column, 2 for the second column, and so on.
  415. * @param mixed[] $criteria The range of cells that contains the conditions you specify.
  416. * You can use any range for the criteria argument, as long as it
  417. * includes at least one column label and at least one cell below
  418. * the column label in which you specify a condition for the
  419. * column.
  420. *
  421. * @return float|string (string if result is an error)
  422. */
  423. public static function DVARP($database, $field, $criteria)
  424. {
  425. return Database\DVarP::evaluate($database, $field, $criteria);
  426. }
  427. }