2007-10-14 01:45:08 +04:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Coverage for Doctrine_Collection</title>
|
|
|
|
<style type="text/css">
|
|
|
|
.covered{ background: green;}
|
|
|
|
.normal{ background: white;}
|
|
|
|
.red{ background: red;}
|
|
|
|
.orange{ background: #f90;}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body><h1>Coverage for Doctrine_Collection</h1><p><a href="index.php">Back to coverage report</a></p><table>
|
|
|
|
<tr><td>1</td>
|
|
|
|
<td class="normal"><?php
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>2</td>
|
|
|
|
<td class="normal">/*
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>3</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * $Id: Collection.php 3172 2007-11-15 22:45:09Z Jonathan.Wage $
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>4</td>
|
|
|
|
<td class="normal"> *
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>5</td>
|
|
|
|
<td class="normal"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>6</td>
|
|
|
|
<td class="normal"> * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>7</td>
|
|
|
|
<td class="normal"> * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>8</td>
|
|
|
|
<td class="normal"> * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>9</td>
|
|
|
|
<td class="normal"> * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>10</td>
|
|
|
|
<td class="normal"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>11</td>
|
|
|
|
<td class="normal"> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>12</td>
|
|
|
|
<td class="normal"> * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>13</td>
|
|
|
|
<td class="normal"> * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>14</td>
|
|
|
|
<td class="normal"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>15</td>
|
|
|
|
<td class="normal"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>16</td>
|
|
|
|
<td class="normal"> *
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>17</td>
|
|
|
|
<td class="normal"> * This software consists of voluntary contributions made by many individuals
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>18</td>
|
|
|
|
<td class="normal"> * and is licensed under the LGPL. For more information, see
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>19</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * <http://www.phpdoctrine.org>.
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>20</td>
|
|
|
|
<td class="normal"> */
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>21</td>
|
|
|
|
<td class="covered">Doctrine::autoload('Doctrine_Access');
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>22</td>
|
|
|
|
<td class="normal">/**
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>23</td>
|
|
|
|
<td class="normal"> * Doctrine_Collection
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>24</td>
|
|
|
|
<td class="normal"> * Collection of Doctrine_Record objects.
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>25</td>
|
|
|
|
<td class="normal"> *
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>26</td>
|
|
|
|
<td class="normal"> * @package Doctrine
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>27</td>
|
|
|
|
<td class="normal"> * @subpackage Collection
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>28</td>
|
|
|
|
<td class="normal"> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>29</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @link www.phpdoctrine.org
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>30</td>
|
|
|
|
<td class="normal"> * @since 1.0
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>31</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @version $Revision: 3172 $
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>32</td>
|
|
|
|
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>33</td>
|
|
|
|
<td class="normal"> */
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>34</td>
|
|
|
|
<td class="covered">class Doctrine_Collection extends Doctrine_Access implements Countable, IteratorAggregate, Serializable
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>35</td>
|
|
|
|
<td class="normal">{
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>36</td>
|
|
|
|
<td class="normal"> /**
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>37</td>
|
|
|
|
<td class="normal"> * @var array $data an array containing the records of this collection
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>38</td>
|
|
|
|
<td class="normal"> */
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>39</td>
|
|
|
|
<td class="normal"> protected $data = array();
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>40</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>41</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>42</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @var Doctrine_Table $table each collection has only records of specified table
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>43</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>44</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> protected $_table;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>45</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>46</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>47</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @var array $_snapshot a snapshot of the fetched data
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>48</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>49</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> protected $_snapshot = array();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>50</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>51</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>52</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @var Doctrine_Record $reference collection can belong to a record
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>53</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>54</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> protected $reference;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>55</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>56</td>
|
|
|
|
<td class="normal"> /**
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>57</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @var string $referenceField the reference field of the collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>58</td>
|
|
|
|
<td class="normal"> */
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>59</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> protected $referenceField;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>60</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>61</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>62</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @var Doctrine_Relation the record this collection is related to, if any
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>63</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>64</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> protected $relation;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>65</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>66</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>67</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @var string $keyColumn the name of the column that is used for collection key mapping
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>68</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>69</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> protected $keyColumn;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>70</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>71</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>72</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @var Doctrine_Null $null used for extremely fast null value testing
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>73</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>74</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> protected static $null;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>75</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>76</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>77</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>78</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * constructor
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>79</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>80</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @param Doctrine_Table|string $table
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>81</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>82</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> public function __construct($table, $keyColumn = null)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>83</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>84</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> if ( ! ($table instanceof Doctrine_Table)) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>85</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> $table = Doctrine_Manager::getInstance()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>86</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> ->getTable($table);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>87</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>88</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> $this->_table = $table;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>89</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>90</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> if ($keyColumn === null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>91</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> $keyColumn = $table->getBoundQueryPart('indexBy');
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>92</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>93</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>94</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> if ($keyColumn !== null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>95</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> $this->keyColumn = $keyColumn;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>96</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>97</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>98</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>99</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>100</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * initNullObject
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>101</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * initializes the null object for this collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>102</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>103</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @return void
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>104</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>105</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> public static function initNullObject(Doctrine_Null $null)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>106</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>107</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> self::$null = $null;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>108</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>109</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>110</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>111</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * getTable
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>112</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * returns the table this collection belongs to
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>113</td>
|
|
|
|
<td class="normal"> *
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>114</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @return Doctrine_Table
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>115</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>116</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> public function getTable()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>117</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>118</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> return $this->_table;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>119</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>120</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>121</td>
|
|
|
|
<td class="normal"> /**
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>122</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * setData
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>123</td>
|
|
|
|
<td class="normal"> *
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>124</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @param array $data
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>125</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @return Doctrine_Collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>126</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>127</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> public function setData(array $data)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>128</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>129</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> $this->data = $data;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>130</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>131</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>132</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>133</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * this method is automatically called when this Doctrine_Collection is serialized
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>134</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>135</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @return array
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>136</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>137</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> public function serialize()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>138</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>139</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> $vars = get_object_vars($this);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>140</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>141</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> unset($vars['reference']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>142</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> unset($vars['reference_field']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>143</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> unset($vars['relation']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>144</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> unset($vars['expandable']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>145</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> unset($vars['expanded']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>146</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> unset($vars['generator']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>147</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>148</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> $vars['_table'] = $vars['_table']->getComponentName();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>149</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>150</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> return serialize($vars);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>151</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>152</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>153</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>154</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * unseralize
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>155</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * this method is automatically called everytime a Doctrine_Collection object is unserialized
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>156</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>157</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> * @return void
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>158</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>159</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> public function unserialize($serialized)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>160</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>161</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> $manager = Doctrine_Manager::getInstance();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>162</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> $connection = $manager->getCurrentConnection();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>163</td>
|
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>164</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> $array = unserialize($serialized);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>165</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>166</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> foreach ($array as $name => $values) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>167</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> $this->$name = $values;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>168</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>169</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>170</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="red"> $this->_table = $connection->getTable($this->_table);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>171</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>172</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $keyColumn = isset($array['keyColumn']) ? $array['keyColumn'] : null;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>173</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ($keyColumn === null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>174</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $keyColumn = $this->_table->getBoundQueryPart('indexBy');
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>175</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>176</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>177</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ($keyColumn !== null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>178</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $this->keyColumn = $keyColumn;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>179</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>180</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>181</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>182</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>183</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * setKeyColumn
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>184</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * sets the key column for this collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>185</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>186</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param string $column
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>187</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return Doctrine_Collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>188</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>189</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function setKeyColumn($column)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>190</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>191</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $this->keyColumn = $column;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>192</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>193</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return $this;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>194</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>195</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>196</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>197</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * getKeyColumn
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>198</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns the name of the key column
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>199</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>200</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return string
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>201</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>202</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function getKeyColumn()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>203</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>204</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return $this->column;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>205</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>206</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>207</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>208</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * getData
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>209</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns all the records as an array
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>210</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>211</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return array
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>212</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>213</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function getData()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>214</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>215</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return $this->data;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>216</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>217</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>218</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>219</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * getFirst
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>220</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns the first record in the collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>221</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>222</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return mixed
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>223</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>224</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function getFirst()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>225</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>226</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return reset($this->data);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>227</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>228</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>229</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>230</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * getLast
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>231</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns the last record in the collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>232</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>233</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return mixed
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>234</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>235</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function getLast()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>236</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>237</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return end($this->data);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>238</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>239</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>240</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns the last record in the collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>241</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>242</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return mixed
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>243</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>244</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function end()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>245</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>246</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return end($this->data);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>247</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>248</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>249</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns the current key
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>250</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>251</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return mixed
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>252</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>253</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function key()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>254</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>255</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return key($this->data);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>256</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>257</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>258</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * setReference
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>259</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * sets a reference pointer
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>260</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>261</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return void
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>262</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>263</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function setReference(Doctrine_Record $record, Doctrine_Relation $relation)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>264</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>265</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $this->reference = $record;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>266</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $this->relation = $relation;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>267</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>268</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if ($relation instanceof Doctrine_Relation_ForeignKey ||
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>269</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $relation instanceof Doctrine_Relation_LocalKey) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>270</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>271</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $this->referenceField = $relation->getForeign();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>272</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>273</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $value = $record->get($relation->getLocal());
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>274</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>275</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> foreach ($this->data as $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>276</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if ($value !== null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>277</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $record->set($this->referenceField, $value, false);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>278</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> } else {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>279</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $record->set($this->referenceField, $this->reference, false);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>280</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>281</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>282</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> } elseif ($relation instanceof Doctrine_Relation_Association) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>283</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>284</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>285</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>286</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>287</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>288</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * getReference
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>289</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>290</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return mixed
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>291</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>292</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function getReference()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>293</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>294</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return $this->reference;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>295</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>296</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>297</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>298</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * remove
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>299</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * removes a specified collection element
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>300</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>301</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param mixed $key
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>302</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return boolean
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>303</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>304</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function remove($key)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>305</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>306</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $removed = $this->data[$key];
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>307</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>308</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> unset($this->data[$key]);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>309</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return $removed;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>310</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>311</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>312</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>313</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * contains
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>314</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * whether or not this collection contains a specified element
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>315</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>316</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param mixed $key the key of the element
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>317</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return boolean
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>318</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>319</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function contains($key)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>320</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>321</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return isset($this->data[$key]);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>322</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>323</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function search(Doctrine_Record $record)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>324</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>325</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return array_search($record, $this->data, true);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>326</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>327</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>328</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>329</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * get
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>330</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns a record for given key
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>331</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>332</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * There are two special cases:
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>333</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>334</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * 1. if null is given as a key a new record is created and attached
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>335</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * at the end of the collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>336</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>337</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * 2. if given key does not exist, then a new record is create and attached
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>338</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * to the given key
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>339</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>340</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * Collection also maps referential information to newly created records
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>341</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>342</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param mixed $key the key of the element
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>343</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return Doctrine_Record return a specified record
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>344</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>345</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function get($key)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>346</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>347</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if ( ! isset($this->data[$key])) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>348</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $record = $this->_table->create();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>349</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>350</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if (isset($this->referenceField)) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>351</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $value = $this->reference->get($this->relation->getLocal());
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>352</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>353</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if ($value !== null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>354</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $record->set($this->referenceField, $value, false);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>355</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> } else {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>356</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $record->set($this->referenceField, $this->reference, false);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>357</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>358</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>359</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if ($key === null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>360</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $this->data[] = $record;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>361</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> } else {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>362</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $this->data[$key] = $record;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>363</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>364</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>365</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if (isset($this->keyColumn)) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>366</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>367</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> $record->set($this->keyColumn, $key);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>368</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>369</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>370</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return $record;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>371</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>372</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>373</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return $this->data[$key];
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>374</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>375</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>376</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>377</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return array an array containing all primary keys
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>378</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>379</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function getPrimaryKeys()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>380</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>381</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $list = array();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>382</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $name = $this->_table->getIdentifier();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>383</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>384</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($this->data as $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>385</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if (is_array($record) && isset($record[$name])) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>386</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $list[] = $record[$name];
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>387</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> } else {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>388</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $list[] = $record->getIncremented();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>389</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>390</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>391</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return $list;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>392</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>393</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>394</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>395</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns all keys
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>396</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return array
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>397</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>398</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function getKeys()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>399</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>400</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return array_keys($this->data);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>401</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>402</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>403</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>404</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * count
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>405</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * this class implements interface countable
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>406</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns the number of records in this collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>407</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>408</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return integer
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>409</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>410</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function count()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>411</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>412</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return count($this->data);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>413</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>414</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>415</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>416</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * set
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>417</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param integer $key
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>418</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param Doctrine_Record $record
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>419</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return void
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>420</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>421</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function set($key, Doctrine_Record $record)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>422</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>423</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if (isset($this->referenceField)) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>424</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $record->set($this->referenceField, $this->reference, false);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>425</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>426</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>427</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $this->data[$key] = $record;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>428</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>429</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>430</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>431</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * adds a record to collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>432</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param Doctrine_Record $record record to be added
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>433</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param string $key optional key for the record
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>434</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return boolean
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>435</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>436</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function add(Doctrine_Record $record, $key = null)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>437</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>438</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if (isset($this->referenceField)) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>439</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $value = $this->reference->get($this->relation->getLocal());
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>440</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>441</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if ($value !== null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>442</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $record->set($this->referenceField, $value, false);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>443</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> } else {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>444</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $record->set($this->referenceField, $this->reference, false);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>445</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>446</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>447</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>448</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * for some weird reason in_array cannot be used here (php bug ?)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>449</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>450</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * if used it results in fatal error : [ nesting level too deep ]
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>451</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>452</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> foreach ($this->data as $val) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>453</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if ($val === $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>454</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return false;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>455</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>456</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>457</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>458</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if (isset($key)) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>459</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if (isset($this->data[$key])) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>460</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return false;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>461</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>462</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $this->data[$key] = $record;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>463</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return true;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>464</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>465</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>466</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> if (isset($this->keyColumn)) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>467</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $value = $record->get($this->keyColumn);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>468</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ($value === null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>469</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> throw new Doctrine_Collection_Exception("Couldn't create collection index. Record field '".$this->keyColumn."' was null.");
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>470</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>471</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $this->data[$value] = $record;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>472</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> } else {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>473</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $this->data[] = $record;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>474</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>475</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return true;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>476</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>477</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>478</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>479</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * loadRelated
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>480</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>481</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param mixed $name
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>482</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return boolean
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>483</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>484</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function loadRelated($name = null)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>485</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>486</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $list = array();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>487</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $query = new Doctrine_Query($this->_table->getConnection());
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>488</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>489</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ( ! isset($name)) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>490</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($this->data as $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>491</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $value = $record->getIncremented();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>492</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ($value !== null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>493</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $list[] = $value;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>494</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>495</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>496</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $query->from($this->_table->getComponentName() . '(' . implode(", ",$this->_table->getPrimaryKeys()) . ')');
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>497</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $query->where($this->_table->getComponentName() . '.id IN (' . substr(str_repeat("?, ", count($list)),0,-2) . ')');
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>498</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>499</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return $query;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>500</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>501</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>502</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $rel = $this->_table->getRelation($name);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>503</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>504</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ($rel instanceof Doctrine_Relation_LocalKey || $rel instanceof Doctrine_Relation_ForeignKey) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>505</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($this->data as $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>506</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $list[] = $record[$rel->getLocal()];
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>507</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>508</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> } else {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>509</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($this->data as $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>510</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $value = $record->getIncremented();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>511</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ($value !== null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>512</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $list[] = $value;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>513</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>514</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>515</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>516</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>517</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $dql = $rel->getRelationDql(count($list), 'collection');
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>518</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>519</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $coll = $query->query($dql, $list);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>520</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>521</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $this->populateRelated($name, $coll);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>522</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>523</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>524</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>525</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * populateRelated
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>526</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>527</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param string $name
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>528</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param Doctrine_Collection $coll
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>529</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return void
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>530</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>531</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function populateRelated($name, Doctrine_Collection $coll)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>532</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>533</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $rel = $this->_table->getRelation($name);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>534</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $table = $rel->getTable();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>535</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $foreign = $rel->getForeign();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>536</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $local = $rel->getLocal();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>537</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>538</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ($rel instanceof Doctrine_Relation_LocalKey) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>539</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($this->data as $key => $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>540</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($coll as $k => $related) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>541</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ($related[$foreign] == $record[$local]) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>542</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $this->data[$key]->setRelated($name, $related);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>543</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>544</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>545</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>546</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> } elseif ($rel instanceof Doctrine_Relation_ForeignKey) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>547</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($this->data as $key => $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>548</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ( ! $record->exists()) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>549</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> continue;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>550</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>551</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $sub = new Doctrine_Collection($table);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>552</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>553</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($coll as $k => $related) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>554</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ($related[$foreign] == $record[$local]) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>555</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $sub->add($related);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>556</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $coll->remove($k);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>557</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>558</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>559</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>560</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $this->data[$key]->setRelated($name, $sub);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>561</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>562</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> } elseif ($rel instanceof Doctrine_Relation_Association) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>563</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $identifier = $this->_table->getIdentifier();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>564</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $asf = $rel->getAssociationFactory();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>565</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $name = $table->getComponentName();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>566</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>567</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($this->data as $key => $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>568</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ( ! $record->exists()) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>569</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> continue;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>570</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>571</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $sub = new Doctrine_Collection($table);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>572</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($coll as $k => $related) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>573</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> if ($related->get($local) == $record[$identifier]) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>574</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $sub->add($related->get($name));
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>575</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>576</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>577</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $this->data[$key]->setRelated($name, $sub);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>578</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>579</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>580</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>581</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>582</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>583</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>584</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * getNormalIterator
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>585</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns normal iterator - an iterator that will not expand this collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>586</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>587</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return Doctrine_Iterator_Normal
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>588</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>589</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function getNormalIterator()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>590</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>591</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return new Doctrine_Collection_Iterator_Normal($this);
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>592</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>593</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>594</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>595</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * takeSnapshot
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>596</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * takes a snapshot from this collection
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>597</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>598</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * snapshots are used for diff processing, for example
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>599</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * when a fetched collection has three elements, then two of those
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>600</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * are being removed the diff would contain one element
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>601</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>602</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * Doctrine_Collection::save() attaches the diff with the help of last
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>603</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * snapshot.
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>604</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>605</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return Doctrine_Collection
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>606</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>607</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function takeSnapshot()
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>608</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>609</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $this->_snapshot = $this->data;
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>610</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>611</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return $this;
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>612</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>613</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>614</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>615</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * getSnapshot
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>616</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * returns the data of the last snapshot
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>617</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>618</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return array returns the data in last snapshot
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>619</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>620</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function getSnapshot()
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>621</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>622</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return $this->_snapshot;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-21 20:12:20 +04:00
|
|
|
<tr><td>623</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-21 20:12:20 +04:00
|
|
|
<tr><td>624</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-21 20:12:20 +04:00
|
|
|
<tr><td>625</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-21 20:12:20 +04:00
|
|
|
<tr><td>626</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * processDiff
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-21 20:12:20 +04:00
|
|
|
<tr><td>627</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * processes the difference of the last snapshot and the current data
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>628</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-21 20:12:20 +04:00
|
|
|
<tr><td>629</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * an example:
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-21 20:12:20 +04:00
|
|
|
<tr><td>630</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * Snapshot with the objects 1, 2 and 4
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>631</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * Current data with objects 2, 3 and 5
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>632</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>633</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * The process would remove object 4
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>634</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>635</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @return Doctrine_Collection
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>636</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>637</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function processDiff()
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>638</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>639</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> foreach (array_udiff($this->_snapshot, $this->data, array($this, "compareRecords")) as $record) {
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>640</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> $record->delete();
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>641</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> }
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>642</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>643</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="covered"> return $this;
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>644</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>645</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>646</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-24 00:21:22 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>647</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * toArray
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>648</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * Mimics the result of a $query->execute(array(), Doctrine::FETCH_ARRAY);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>649</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>650</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> * @param boolean $deep
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>651</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>652</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> public function toArray($deep = false, $prefixKey = false)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>653</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>654</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $data = array();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>655</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> foreach ($this as $key => $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>656</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>657</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $key = $prefixKey ? get_class($record) . '_' .$key:$key;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>658</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>659</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> $data[$key] = $record->toArray($deep, $prefixKey);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>660</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>661</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>662</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="red"> return $data;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>663</td>
|
2007-11-09 01:14:39 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>664</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>665</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>666</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * fromArray
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>667</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>668</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * Populate a Doctrine_Collection from an array of data
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>669</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>670</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @param string $array
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>671</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @return void
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>672</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-10-24 00:21:22 +04:00
|
|
|
<tr><td>673</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>674</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> public function fromArray($array)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>675</td>
|
2007-10-14 01:45:08 +04:00
|
|
|
<td class="normal"> {
|
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>676</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> $data = array();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>677</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> foreach ($array as $rowKey => $row) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>678</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> $this[$rowKey]->fromArray($row);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>679</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>680</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>681</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>682</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>683</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * exportTo
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>684</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>685</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * Export a Doctrine_Collection to one of the supported Doctrine_Parser formats
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>686</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>687</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @param string $type
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>688</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @param string $deep
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>689</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @return void
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>690</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>691</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> public function exportTo($type, $deep = false)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>692</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>693</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> if ($type == 'array') {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>694</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> return $this->toArray($deep);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>695</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="orange"> } else {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>696</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> return Doctrine_Parser::dump($this->toArray($deep, true), $type);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>697</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>698</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="orange"> }
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>699</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>700</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>701</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * importFrom
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>702</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>703</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * Import data to a Doctrine_Collection from one of the supported Doctrine_Parser formats
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>704</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>705</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @param string $type
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>706</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @param string $data
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>707</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @return void
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>708</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> */
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>709</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> public function importFrom($type, $data)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>710</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>711</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> if ($type == 'array') {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>712</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> return $this->fromArray($data);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>713</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="orange"> } else {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>714</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="red"> return $this->fromArray(Doctrine_Parser::load($data, $type));
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>715</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>716</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>717</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>718</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>719</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * getDeleteDiff
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>720</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>721</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @return void
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>722</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>723</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> public function getDeleteDiff()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>724</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>725</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> return array_udiff($this->_snapshot, $this->data, array($this, "compareRecords"));
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>726</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>727</td>
|
2007-10-14 01:45:08 +04:00
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>728</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>729</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * getInsertDiff
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>730</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>731</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @return void
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>732</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>733</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> public function getInsertDiff()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>734</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>735</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> return array_udiff($this->data, $this->_snapshot, array($this, "compareRecords"));
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>736</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="orange"> }
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>737</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>738</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>739</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * compareRecords
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>740</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * Compares two records. To be used on _snapshot diffs using array_udiff
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>741</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>742</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> protected function compareRecords($a, $b)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>743</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>744</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> if ($a->getOid() == $b->getOid()) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>745</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> return 0;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>746</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>747</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>748</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> return ($a->getOid() > $b->getOid()) ? 1 : -1;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>749</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>750</td>
|
2007-10-14 01:45:08 +04:00
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>751</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>752</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * save
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>753</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * saves all records of this collection and processes the
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>754</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * difference of the last snapshot and the current data
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>755</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>756</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @param Doctrine_Connection $conn optional connection parameter
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>757</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @return Doctrine_Collection
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>758</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>759</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> public function save(Doctrine_Connection $conn = null)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>760</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>761</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> if ($conn == null) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>762</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> $conn = $this->_table->getConnection();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>763</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>764</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>765</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> $conn->beginTransaction();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>766</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>767</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> $conn->transaction->addCollection($this);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>768</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>769</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> $this->processDiff();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>770</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>771</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> foreach ($this->getData() as $key => $record) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>772</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> $record->save($conn);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>773</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>774</td>
|
2007-10-21 20:12:20 +04:00
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>775</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> $conn->commit();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>776</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>777</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> return $this;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>778</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>779</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>780</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>781</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * delete
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>782</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * single shot delete
|
2007-11-07 19:12:14 +03:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>783</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * deletes all records from this collection
|
2007-11-07 19:12:14 +03:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>784</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * and uses only one database query to perform this operation
|
2007-11-07 19:12:14 +03:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>785</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> *
|
2007-11-07 19:12:14 +03:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>786</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> * @return Doctrine_Collection
|
2007-11-07 19:12:14 +03:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>787</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> */
|
2007-11-07 19:12:14 +03:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>788</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> public function delete(Doctrine_Connection $conn = null)
|
2007-11-07 19:12:14 +03:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>789</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="normal"> {
|
2007-11-07 19:12:14 +03:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>790</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> if ($conn == null) {
|
2007-11-07 19:12:14 +03:00
|
|
|
</td></tr>
|
2007-11-09 01:14:39 +03:00
|
|
|
<tr><td>791</td>
|
2007-11-25 23:32:49 +03:00
|
|
|
<td class="covered"> $conn = $this->_table->getConnection();
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>792</td>
|
|
|
|
<td class="covered"> }
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>793</td>
|
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>794</td>
|
|
|
|
<td class="covered"> $conn->beginTransaction();
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>795</td>
|
|
|
|
<td class="covered"> $conn->transaction->addCollection($this);
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>796</td>
|
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>797</td>
|
|
|
|
<td class="covered"> foreach ($this as $key => $record) {
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>798</td>
|
|
|
|
<td class="covered"> $record->delete($conn);
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>799</td>
|
|
|
|
<td class="covered"> }
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>800</td>
|
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>801</td>
|
|
|
|
<td class="covered"> $conn->commit();
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>802</td>
|
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>803</td>
|
|
|
|
<td class="covered"> $this->data = array();
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>804</td>
|
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>805</td>
|
|
|
|
<td class="covered"> return $this;
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>806</td>
|
|
|
|
<td class="orange"> }
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>807</td>
|
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>808</td>
|
|
|
|
<td class="normal"> /**
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>809</td>
|
|
|
|
<td class="normal"> * getIterator
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>810</td>
|
|
|
|
<td class="normal"> * @return object ArrayIterator
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>811</td>
|
|
|
|
<td class="normal"> */
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>812</td>
|
|
|
|
<td class="normal"> public function getIterator()
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>813</td>
|
|
|
|
<td class="normal"> {
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>814</td>
|
|
|
|
<td class="covered"> $data = $this->data;
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>815</td>
|
|
|
|
<td class="covered"> return new ArrayIterator($data);
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>816</td>
|
|
|
|
<td class="orange"> }
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>817</td>
|
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>818</td>
|
|
|
|
<td class="normal"> /**
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>819</td>
|
|
|
|
<td class="normal"> * returns a string representation of this object
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>820</td>
|
|
|
|
<td class="normal"> */
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>821</td>
|
|
|
|
<td class="normal"> public function __toString()
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>822</td>
|
|
|
|
<td class="normal"> {
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>823</td>
|
|
|
|
<td class="red"> return Doctrine_Lib::getCollectionAsString($this);
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>824</td>
|
|
|
|
<td class="orange"> }
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>825</td>
|
|
|
|
<td class="normal">
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>826</td>
|
|
|
|
<td class="normal"> /**
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>827</td>
|
|
|
|
<td class="normal"> * returns the relation object
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>828</td>
|
|
|
|
<td class="normal"> * @return object Doctrine_Relation
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>829</td>
|
|
|
|
<td class="normal"> */
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>830</td>
|
|
|
|
<td class="normal"> public function getRelation()
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>831</td>
|
|
|
|
<td class="normal"> {
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>832</td>
|
|
|
|
<td class="red"> return $this->relation;
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>833</td>
|
|
|
|
<td class="orange"> }
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>834</td>
|
2007-10-14 01:45:08 +04:00
|
|
|
<td class="normal">}
|
|
|
|
</td></tr>
|
|
|
|
</table></body></html>
|