new coverage data
This commit is contained in:
parent
63815bacca
commit
42927503f5
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Access.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: Access.php 3189 2007-11-18 20:37:44Z meus $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -106,7 +106,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>33</td>
|
||||
<td class="normal"> * @version $Revision: 2963 $
|
||||
<td class="normal"> * @version $Revision: 3189 $
|
||||
</td></tr>
|
||||
<tr><td>34</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -325,138 +325,147 @@
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="normal"> * @param mixed $offset
|
||||
<td class="normal"> * Check if an offsetExists. Alias for contains.
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal"> * @return boolean whether or not this object contains $offset
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @param mixed $offset
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal"> public function offsetExists($offset)
|
||||
<td class="normal"> * @return boolean whether or not this object contains $offset
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="covered"> return $this->contains($offset);
|
||||
<td class="normal"> public function offsetExists($offset)
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> return $this->contains($offset);
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="normal"> /**
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="normal"> * offsetGet an alias of get()
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="normal"> * @see get, __get
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="normal"> * @param mixed $offset
|
||||
<td class="normal"> * offsetGet an alias of get()
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="normal"> * @return mixed
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @see get, __get
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="normal"> public function offsetGet($offset)
|
||||
<td class="normal"> * @param mixed $offset
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * @return mixed
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="covered"> return $this->get($offset);
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal"> public function offsetGet($offset)
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="normal"> /**
|
||||
<td class="covered"> return $this->get($offset);
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="normal"> * sets $offset to $value
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="normal"> * @see set, __set
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="normal"> * @param mixed $offset
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="normal"> * @param mixed $value
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="normal"> public function offsetSet($offset, $value)
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="covered"> if ( ! isset($offset)) {
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="covered"> $this->add($value);
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="covered"> $this->set($offset, $value);
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="normal"> * unset a given offset
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="normal"> * @see set, offsetSet, __set
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="normal"> * @param mixed $offset
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="normal"> public function offsetUnset($offset)
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="covered"> return $this->remove($offset);
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="normal"> * sets $offset to $value
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="normal"> * @see set, __set
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="normal"> * @param mixed $offset
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="normal"> * @param mixed $value
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="normal"> public function offsetSet($offset, $value)
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="covered"> if ( ! isset($offset)) {
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="covered"> $this->add($value);
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="covered"> $this->set($offset, $value);
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="normal"> * unset a given offset
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="normal"> * @see set, offsetSet, __set
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="normal"> * @param mixed $offset
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="normal"> public function offsetUnset($offset)
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="covered"> return $this->remove($offset);
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -283,7 +283,7 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="red"> return $this->queries;
|
||||
<td class="covered"> return $this->queries;
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="orange"> }
|
||||
|
@ -136,213 +136,240 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> public function __construct($options)
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * Create a new auditlog_
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="covered"> $this->_options = array_merge($this->_options, $options);
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="covered"> }
|
||||
<td class="normal"> * @param array $options An array of options
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> public function getVersion(Doctrine_Record $record, $version)
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> public function __construct(array $options = array())
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="covered"> $className = $this->_options['className'];
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $this->_options = array_merge($this->_options, $options);
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="covered"> $q = new Doctrine_Query();
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="covered"> $values = array();
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="covered"> foreach ((array) $this->_options['table']->getIdentifier() as $id) {
|
||||
<td class="normal"> * Get the version
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="covered"> $conditions[] = $className . '.' . $id . ' = ?';
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="covered"> $values[] = $record->get($id);
|
||||
<td class="normal"> * @param Doctrine_Record $record
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="covered"> }
|
||||
<td class="normal"> * @param mixed $version
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="covered"> $where = implode(' AND ', $conditions) . ' AND ' . $className . '.' . $this->_options['versionColumn'] . ' = ?';
|
||||
<td class="normal"> * @return array An array with version information
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="covered"> $values[] = $version;
|
||||
<td class="normal"> public function getVersion(Doctrine_Record $record, $version)
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="covered"> $q->from($className)
|
||||
<td class="covered"> $className = $this->_options['className'];
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="covered"> ->where($where);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $q = new Doctrine_Query();
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="covered"> return $q->execute($values, Doctrine::HYDRATE_ARRAY);
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> public function buildDefinition(Doctrine_Table $table)
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="covered"> $this->_options['className'] = str_replace('%CLASS%',
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="covered"> $this->_options['table']->getComponentName(),
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="covered"> $this->_options['className']);
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="covered"> $values = array();
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="covered"> foreach ((array) $this->_options['table']->getIdentifier() as $id) {
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="covered"> $conditions[] = $className . '.' . $id . ' = ?';
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="covered"> $values[] = $record->get($id);
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="covered"> $where = implode(' AND ', $conditions) . ' AND ' . $className . '.' . $this->_options['versionColumn'] . ' = ?';
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="covered"> $name = $table->getComponentName();
|
||||
<td class="covered"> $values[] = $version;
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="covered"> $className = $name . 'Version';
|
||||
<td class="covered"> $q->from($className)
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> ->where($where);
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="normal"> // check that class doesn't exist (otherwise we cannot create it)
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="covered"> if (class_exists($className)) {
|
||||
<td class="covered"> return $q->execute($values, Doctrine::HYDRATE_ARRAY);
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="covered"> return false;
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="covered"> $columns = $table->getColumns();
|
||||
<td class="normal"> * buildDefinition for a table
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal"> // remove all sequence, autoincrement and unique constraint definitions
|
||||
<td class="normal"> * @param Doctrine_Table $table
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="covered"> foreach ($columns as $column => $definition) {
|
||||
<td class="normal"> * @return boolean true on success otherwise false.
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="covered"> unset($columns[$column]['autoincrement']);
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="covered"> unset($columns[$column]['sequence']);
|
||||
<td class="normal"> public function buildDefinition()
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="covered"> unset($columns[$column]['unique']);
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $name = $this->_options['table']->getComponentName();
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal"> // the version column should be part of the primary key definition
|
||||
<td class="covered"> $columns = $this->_options['table']->getColumns();
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="covered"> $columns[$this->_options['versionColumn']] = array('type' => 'integer',
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="covered"> 'length' => 8,
|
||||
<td class="normal"> // remove all sequence, autoincrement and unique constraint definitions
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="covered"> 'primary' => true);
|
||||
<td class="covered"> foreach ($columns as $column => $definition) {
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> unset($columns[$column]['autoincrement']);
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="covered"> $id = $table->getIdentifier();
|
||||
<td class="covered"> unset($columns[$column]['sequence']);
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> unset($columns[$column]['unique']);
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="covered"> $options = array('className' => $className);
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="covered"> $relations = array($name => array('local' => $id,
|
||||
<td class="normal"> // the version column should be part of the primary key definition
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="covered"> 'foreign' => $id,
|
||||
<td class="covered"> $columns[$this->_options['versionColumn']] = array('type' => 'integer',
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="covered"> 'onDelete' => 'CASCADE',
|
||||
<td class="covered"> 'length' => 8,
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="covered"> 'onUpdate' => 'CASCADE'));
|
||||
<td class="covered"> 'primary' => true);
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="covered"> $this->generateClass($options, $columns, array());
|
||||
<td class="covered"> $id = $this->_options['table']->getIdentifier();
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="covered"> $this->_options['pluginTable'] = $table->getConnection()->getTable($this->_options['className']);
|
||||
<td class="covered"> $options = array('className' => $this->_options['className']);
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="covered"> return true;
|
||||
<td class="covered"> $relations = array($name => array('local' => $id,
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> 'foreign' => $id,
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="covered"> 'onDelete' => 'CASCADE',
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="covered"> 'onUpdate' => 'CASCADE'));
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="covered"> $this->generateClass($options, $columns, array());
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="covered"> $this->_options['pluginTable'] = $this->_options['table']->getConnection()->getTable($this->_options['className']);
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="covered"> return true;
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Collection.php 3093 2007-11-08 20:52:49Z wolfpakz $
|
||||
<td class="normal"> * $Id: Collection.php 3172 2007-11-15 22:45:09Z Jonathan.Wage $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -100,7 +100,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @version $Revision: 3093 $
|
||||
<td class="normal"> * @version $Revision: 3172 $
|
||||
</td></tr>
|
||||
<tr><td>32</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -292,10 +292,10 @@
|
||||
<td class="covered"> if ($keyColumn !== null) {
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="red"> $this->keyColumn = $keyColumn;
|
||||
<td class="covered"> $this->keyColumn = $keyColumn;
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="red"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="covered"> }
|
||||
@ -361,7 +361,7 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="red"> return $this->_table;
|
||||
<td class="covered"> return $this->_table;
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="orange"> }
|
||||
@ -1108,10 +1108,10 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>367</td>
|
||||
<td class="red"> $record->set($this->keyColumn, $key);
|
||||
<td class="covered"> $record->set($this->keyColumn, $key);
|
||||
</td></tr>
|
||||
<tr><td>368</td>
|
||||
<td class="red"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>369</td>
|
||||
<td class="normal">
|
||||
@ -1999,387 +1999,516 @@
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>664</td>
|
||||
<td class="normal"> public function fromArray($array)
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>665</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>666</td>
|
||||
<td class="red"> $data = array();
|
||||
<td class="normal"> * fromArray
|
||||
</td></tr>
|
||||
<tr><td>667</td>
|
||||
<td class="red"> foreach ($array as $row) {
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>668</td>
|
||||
<td class="red"> $record = $this->_table->getRecord();
|
||||
<td class="normal"> * Populate a Doctrine_Collection from an array of data
|
||||
</td></tr>
|
||||
<tr><td>669</td>
|
||||
<td class="red"> $record->fromArray($row);
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>670</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> * @param string $array
|
||||
</td></tr>
|
||||
<tr><td>671</td>
|
||||
<td class="red"> $this[] = $record;
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>672</td>
|
||||
<td class="red"> }
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>673</td>
|
||||
<td class="red"> }
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>674</td>
|
||||
<td class="normal"> public function exportTo($type, $deep = false)
|
||||
<td class="normal"> public function fromArray($array)
|
||||
</td></tr>
|
||||
<tr><td>675</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>676</td>
|
||||
<td class="red"> if ($type == 'array') {
|
||||
<td class="red"> $data = array();
|
||||
</td></tr>
|
||||
<tr><td>677</td>
|
||||
<td class="red"> return $this->toArray($deep);
|
||||
<td class="red"> foreach ($array as $rowKey => $row) {
|
||||
</td></tr>
|
||||
<tr><td>678</td>
|
||||
<td class="orange"> } else {
|
||||
<td class="red"> $this[$rowKey]->fromArray($row);
|
||||
</td></tr>
|
||||
<tr><td>679</td>
|
||||
<td class="red"> return Doctrine_Parser::dump($this->toArray($deep, true), $type);
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>680</td>
|
||||
<td class="normal"> }
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>681</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>682</td>
|
||||
<td class="normal"> public function importFrom($type, $data)
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>683</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * exportTo
|
||||
</td></tr>
|
||||
<tr><td>684</td>
|
||||
<td class="red"> if ($type == 'array') {
|
||||
</td></tr>
|
||||
<tr><td>685</td>
|
||||
<td class="red"> return $this->fromArray($data);
|
||||
</td></tr>
|
||||
<tr><td>686</td>
|
||||
<td class="orange"> } else {
|
||||
</td></tr>
|
||||
<tr><td>687</td>
|
||||
<td class="red"> return $this->fromArray(Doctrine_Parser::load($data, $type));
|
||||
</td></tr>
|
||||
<tr><td>688</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>689</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>690</td>
|
||||
<td class="normal"> public function getDeleteDiff()
|
||||
</td></tr>
|
||||
<tr><td>691</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>692</td>
|
||||
<td class="covered"> return array_udiff($this->_snapshot, $this->data, array($this, "compareRecords"));
|
||||
</td></tr>
|
||||
<tr><td>693</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>694</td>
|
||||
<td class="normal"> public function getInsertDiff()
|
||||
</td></tr>
|
||||
<tr><td>695</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>696</td>
|
||||
<td class="covered"> return array_udiff($this->data, $this->_snapshot, array($this, "compareRecords"));
|
||||
</td></tr>
|
||||
<tr><td>697</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>698</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>699</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>700</td>
|
||||
<td class="normal"> * compareRecords
|
||||
</td></tr>
|
||||
<tr><td>701</td>
|
||||
<td class="normal"> * Compares two records. To be used on _snapshot diffs using array_udiff
|
||||
</td></tr>
|
||||
<tr><td>702</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>703</td>
|
||||
<td class="normal"> protected function compareRecords($a, $b)
|
||||
</td></tr>
|
||||
<tr><td>704</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>705</td>
|
||||
<td class="covered"> if ($a->getOid() == $b->getOid()) return 0;
|
||||
</td></tr>
|
||||
<tr><td>706</td>
|
||||
<td class="covered"> return ($a->getOid() > $b->getOid()) ? 1 : -1;
|
||||
</td></tr>
|
||||
<tr><td>707</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>708</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>709</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>710</td>
|
||||
<td class="normal"> * save
|
||||
</td></tr>
|
||||
<tr><td>711</td>
|
||||
<td class="normal"> * saves all records of this collection and processes the
|
||||
</td></tr>
|
||||
<tr><td>712</td>
|
||||
<td class="normal"> * difference of the last snapshot and the current data
|
||||
</td></tr>
|
||||
<tr><td>713</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>714</td>
|
||||
<td class="normal"> * @param Doctrine_Connection $conn optional connection parameter
|
||||
<tr><td>685</td>
|
||||
<td class="normal"> * Export a Doctrine_Collection to one of the supported Doctrine_Parser formats
|
||||
</td></tr>
|
||||
<tr><td>715</td>
|
||||
<td class="normal"> * @return Doctrine_Collection
|
||||
<tr><td>686</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>716</td>
|
||||
<tr><td>687</td>
|
||||
<td class="normal"> * @param string $type
|
||||
</td></tr>
|
||||
<tr><td>688</td>
|
||||
<td class="normal"> * @param string $deep
|
||||
</td></tr>
|
||||
<tr><td>689</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>690</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>717</td>
|
||||
<td class="normal"> public function save(Doctrine_Connection $conn = null)
|
||||
<tr><td>691</td>
|
||||
<td class="normal"> public function exportTo($type, $deep = false)
|
||||
</td></tr>
|
||||
<tr><td>718</td>
|
||||
<tr><td>692</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>693</td>
|
||||
<td class="red"> if ($type == 'array') {
|
||||
</td></tr>
|
||||
<tr><td>694</td>
|
||||
<td class="red"> return $this->toArray($deep);
|
||||
</td></tr>
|
||||
<tr><td>695</td>
|
||||
<td class="orange"> } else {
|
||||
</td></tr>
|
||||
<tr><td>696</td>
|
||||
<td class="red"> return Doctrine_Parser::dump($this->toArray($deep, true), $type);
|
||||
</td></tr>
|
||||
<tr><td>697</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>698</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>699</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>700</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>701</td>
|
||||
<td class="normal"> * importFrom
|
||||
</td></tr>
|
||||
<tr><td>702</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>703</td>
|
||||
<td class="normal"> * Import data to a Doctrine_Collection from one of the supported Doctrine_Parser formats
|
||||
</td></tr>
|
||||
<tr><td>704</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>705</td>
|
||||
<td class="normal"> * @param string $type
|
||||
</td></tr>
|
||||
<tr><td>706</td>
|
||||
<td class="normal"> * @param string $data
|
||||
</td></tr>
|
||||
<tr><td>707</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>708</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>709</td>
|
||||
<td class="normal"> public function importFrom($type, $data)
|
||||
</td></tr>
|
||||
<tr><td>710</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>711</td>
|
||||
<td class="red"> if ($type == 'array') {
|
||||
</td></tr>
|
||||
<tr><td>712</td>
|
||||
<td class="red"> return $this->fromArray($data);
|
||||
</td></tr>
|
||||
<tr><td>713</td>
|
||||
<td class="orange"> } else {
|
||||
</td></tr>
|
||||
<tr><td>714</td>
|
||||
<td class="red"> return $this->fromArray(Doctrine_Parser::load($data, $type));
|
||||
</td></tr>
|
||||
<tr><td>715</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>716</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>717</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>718</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>719</td>
|
||||
<td class="covered"> if ($conn == null) {
|
||||
<td class="normal"> * getDeleteDiff
|
||||
</td></tr>
|
||||
<tr><td>720</td>
|
||||
<td class="covered"> $conn = $this->_table->getConnection();
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>721</td>
|
||||
<td class="covered"> }
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>722</td>
|
||||
<td class="covered"> $conn->beginTransaction();
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>723</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> public function getDeleteDiff()
|
||||
</td></tr>
|
||||
<tr><td>724</td>
|
||||
<td class="covered"> $conn->transaction->addCollection($this);
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>725</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> return array_udiff($this->_snapshot, $this->data, array($this, "compareRecords"));
|
||||
</td></tr>
|
||||
<tr><td>726</td>
|
||||
<td class="covered"> $this->processDiff();
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>727</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>728</td>
|
||||
<td class="covered"> foreach ($this->getData() as $key => $record) {
|
||||
</td></tr>
|
||||
<tr><td>729</td>
|
||||
<td class="covered"> $record->save($conn);
|
||||
</td></tr>
|
||||
<tr><td>730</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>731</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>732</td>
|
||||
<td class="covered"> $conn->commit();
|
||||
</td></tr>
|
||||
<tr><td>733</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>734</td>
|
||||
<td class="covered"> return $this;
|
||||
</td></tr>
|
||||
<tr><td>735</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>736</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>737</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>738</td>
|
||||
<td class="normal"> * delete
|
||||
<tr><td>729</td>
|
||||
<td class="normal"> * getInsertDiff
|
||||
</td></tr>
|
||||
<tr><td>739</td>
|
||||
<td class="normal"> * single shot delete
|
||||
</td></tr>
|
||||
<tr><td>740</td>
|
||||
<td class="normal"> * deletes all records from this collection
|
||||
</td></tr>
|
||||
<tr><td>741</td>
|
||||
<td class="normal"> * and uses only one database query to perform this operation
|
||||
</td></tr>
|
||||
<tr><td>742</td>
|
||||
<tr><td>730</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>743</td>
|
||||
<td class="normal"> * @return Doctrine_Collection
|
||||
<tr><td>731</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>744</td>
|
||||
<tr><td>732</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>745</td>
|
||||
<td class="normal"> public function delete(Doctrine_Connection $conn = null)
|
||||
<tr><td>733</td>
|
||||
<td class="normal"> public function getInsertDiff()
|
||||
</td></tr>
|
||||
<tr><td>746</td>
|
||||
<tr><td>734</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>735</td>
|
||||
<td class="covered"> return array_udiff($this->data, $this->_snapshot, array($this, "compareRecords"));
|
||||
</td></tr>
|
||||
<tr><td>736</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>737</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>738</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>739</td>
|
||||
<td class="normal"> * compareRecords
|
||||
</td></tr>
|
||||
<tr><td>740</td>
|
||||
<td class="normal"> * Compares two records. To be used on _snapshot diffs using array_udiff
|
||||
</td></tr>
|
||||
<tr><td>741</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>742</td>
|
||||
<td class="normal"> protected function compareRecords($a, $b)
|
||||
</td></tr>
|
||||
<tr><td>743</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>744</td>
|
||||
<td class="covered"> if ($a->getOid() == $b->getOid()) {
|
||||
</td></tr>
|
||||
<tr><td>745</td>
|
||||
<td class="covered"> return 0;
|
||||
</td></tr>
|
||||
<tr><td>746</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>747</td>
|
||||
<td class="covered"> if ($conn == null) {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>748</td>
|
||||
<td class="covered"> $conn = $this->_table->getConnection();
|
||||
<td class="covered"> return ($a->getOid() > $b->getOid()) ? 1 : -1;
|
||||
</td></tr>
|
||||
<tr><td>749</td>
|
||||
<td class="covered"> }
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>750</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>751</td>
|
||||
<td class="covered"> $conn->beginTransaction();
|
||||
</td></tr>
|
||||
<tr><td>752</td>
|
||||
<td class="covered"> $conn->transaction->addCollection($this);
|
||||
</td></tr>
|
||||
<tr><td>753</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>754</td>
|
||||
<td class="covered"> foreach ($this as $key => $record) {
|
||||
</td></tr>
|
||||
<tr><td>755</td>
|
||||
<td class="covered"> $record->delete($conn);
|
||||
</td></tr>
|
||||
<tr><td>756</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>757</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>758</td>
|
||||
<td class="covered"> $conn->commit();
|
||||
</td></tr>
|
||||
<tr><td>759</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>760</td>
|
||||
<td class="covered"> $this->data = array();
|
||||
</td></tr>
|
||||
<tr><td>761</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>762</td>
|
||||
<td class="covered"> return $this;
|
||||
</td></tr>
|
||||
<tr><td>763</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>764</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>765</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>766</td>
|
||||
<td class="normal"> * getIterator
|
||||
<tr><td>752</td>
|
||||
<td class="normal"> * save
|
||||
</td></tr>
|
||||
<tr><td>767</td>
|
||||
<td class="normal"> * @return object ArrayIterator
|
||||
<tr><td>753</td>
|
||||
<td class="normal"> * saves all records of this collection and processes the
|
||||
</td></tr>
|
||||
<tr><td>768</td>
|
||||
<tr><td>754</td>
|
||||
<td class="normal"> * difference of the last snapshot and the current data
|
||||
</td></tr>
|
||||
<tr><td>755</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>756</td>
|
||||
<td class="normal"> * @param Doctrine_Connection $conn optional connection parameter
|
||||
</td></tr>
|
||||
<tr><td>757</td>
|
||||
<td class="normal"> * @return Doctrine_Collection
|
||||
</td></tr>
|
||||
<tr><td>758</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>769</td>
|
||||
<td class="normal"> public function getIterator()
|
||||
<tr><td>759</td>
|
||||
<td class="normal"> public function save(Doctrine_Connection $conn = null)
|
||||
</td></tr>
|
||||
<tr><td>770</td>
|
||||
<tr><td>760</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>761</td>
|
||||
<td class="covered"> if ($conn == null) {
|
||||
</td></tr>
|
||||
<tr><td>762</td>
|
||||
<td class="covered"> $conn = $this->_table->getConnection();
|
||||
</td></tr>
|
||||
<tr><td>763</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>764</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>765</td>
|
||||
<td class="covered"> $conn->beginTransaction();
|
||||
</td></tr>
|
||||
<tr><td>766</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>767</td>
|
||||
<td class="covered"> $conn->transaction->addCollection($this);
|
||||
</td></tr>
|
||||
<tr><td>768</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>769</td>
|
||||
<td class="covered"> $this->processDiff();
|
||||
</td></tr>
|
||||
<tr><td>770</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>771</td>
|
||||
<td class="covered"> $data = $this->data;
|
||||
<td class="covered"> foreach ($this->getData() as $key => $record) {
|
||||
</td></tr>
|
||||
<tr><td>772</td>
|
||||
<td class="covered"> return new ArrayIterator($data);
|
||||
<td class="covered"> $record->save($conn);
|
||||
</td></tr>
|
||||
<tr><td>773</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>774</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>775</td>
|
||||
<td class="normal"> /**
|
||||
<td class="covered"> $conn->commit();
|
||||
</td></tr>
|
||||
<tr><td>776</td>
|
||||
<td class="normal"> * returns a string representation of this object
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>777</td>
|
||||
<td class="normal"> */
|
||||
<td class="covered"> return $this;
|
||||
</td></tr>
|
||||
<tr><td>778</td>
|
||||
<td class="normal"> public function __toString()
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>779</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>780</td>
|
||||
<td class="red"> return Doctrine_Lib::getCollectionAsString($this);
|
||||
</td></tr>
|
||||
<tr><td>781</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>782</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>783</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>781</td>
|
||||
<td class="normal"> * delete
|
||||
</td></tr>
|
||||
<tr><td>782</td>
|
||||
<td class="normal"> * single shot delete
|
||||
</td></tr>
|
||||
<tr><td>783</td>
|
||||
<td class="normal"> * deletes all records from this collection
|
||||
</td></tr>
|
||||
<tr><td>784</td>
|
||||
<td class="normal"> * returns the relation object
|
||||
<td class="normal"> * and uses only one database query to perform this operation
|
||||
</td></tr>
|
||||
<tr><td>785</td>
|
||||
<td class="normal"> * @return object Doctrine_Relation
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>786</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @return Doctrine_Collection
|
||||
</td></tr>
|
||||
<tr><td>787</td>
|
||||
<td class="normal"> public function getRelation()
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>788</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> public function delete(Doctrine_Connection $conn = null)
|
||||
</td></tr>
|
||||
<tr><td>789</td>
|
||||
<td class="red"> return $this->relation;
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>790</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> if ($conn == null) {
|
||||
</td></tr>
|
||||
<tr><td>791</td>
|
||||
<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>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Configurable.php 3067 2007-11-02 16:59:20Z phuson $
|
||||
<td class="normal"> * $Id: Configurable.php 3223 2007-11-25 19:07:30Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -103,7 +103,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>32</td>
|
||||
<td class="normal"> * @version $Revision: 3067 $
|
||||
<td class="normal"> * @version $Revision: 3223 $
|
||||
</td></tr>
|
||||
<tr><td>33</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -322,412 +322,412 @@
|
||||
<td class="covered"> case Doctrine::ATTR_CACHE:
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="covered"> if ($value !== null) {
|
||||
<td class="covered"> case Doctrine::ATTR_RESULT_CACHE:
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="covered"> if ( ! ($value instanceof Doctrine_Cache_Interface)) {
|
||||
<td class="covered"> case Doctrine::ATTR_QUERY_CACHE:
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="red"> throw new Doctrine_Exception('Cache driver should implement Doctrine_Cache_Interface');
|
||||
<td class="covered"> if ($value !== null) {
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> if ( ! ($value instanceof Doctrine_Cache_Interface)) {
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="covered"> }
|
||||
<td class="red"> throw new Doctrine_Exception('Cache driver should implement Doctrine_Cache_Interface');
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="covered"> break;
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="covered"> case Doctrine::ATTR_VALIDATE:
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="covered"> case Doctrine::ATTR_QUERY_LIMIT:
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="covered"> case Doctrine::ATTR_QUOTE_IDENTIFIER:
|
||||
<td class="covered"> case Doctrine::ATTR_VALIDATE:
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="covered"> case Doctrine::ATTR_PORTABILITY:
|
||||
<td class="covered"> case Doctrine::ATTR_QUERY_LIMIT:
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="covered"> case Doctrine::ATTR_DEFAULT_TABLE_TYPE:
|
||||
<td class="covered"> case Doctrine::ATTR_QUOTE_IDENTIFIER:
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="covered"> case Doctrine::ATTR_EMULATE_DATABASE:
|
||||
<td class="covered"> case Doctrine::ATTR_PORTABILITY:
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="covered"> case Doctrine::ATTR_USE_NATIVE_ENUM:
|
||||
<td class="covered"> case Doctrine::ATTR_DEFAULT_TABLE_TYPE:
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="covered"> case Doctrine::ATTR_DEFAULT_SEQUENCE:
|
||||
<td class="covered"> case Doctrine::ATTR_EMULATE_DATABASE:
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="covered"> case Doctrine::ATTR_EXPORT:
|
||||
<td class="covered"> case Doctrine::ATTR_USE_NATIVE_ENUM:
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="covered"> case Doctrine::ATTR_DECIMAL_PLACES:
|
||||
<td class="covered"> case Doctrine::ATTR_DEFAULT_SEQUENCE:
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="covered"> case Doctrine::ATTR_LOAD_REFERENCES:
|
||||
<td class="covered"> case Doctrine::ATTR_EXPORT:
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="covered"> case Doctrine::ATTR_RECORD_LISTENER:
|
||||
<td class="covered"> case Doctrine::ATTR_DECIMAL_PLACES:
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="covered"> case Doctrine::ATTR_THROW_EXCEPTIONS:
|
||||
<td class="covered"> case Doctrine::ATTR_LOAD_REFERENCES:
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="covered"> case Doctrine::ATTR_DEFAULT_PARAM_NAMESPACE:
|
||||
<td class="covered"> case Doctrine::ATTR_RECORD_LISTENER:
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> case Doctrine::ATTR_THROW_EXCEPTIONS:
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="covered"> break;
|
||||
<td class="covered"> case Doctrine::ATTR_DEFAULT_PARAM_NAMESPACE:
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="covered"> case Doctrine::ATTR_SEQCOL_NAME:
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> if ( ! is_string($value)) {
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="red"> throw new Doctrine_Exception('Sequence column name attribute only accepts string values');
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="covered"> case Doctrine::ATTR_FIELD_CASE:
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="red"> if ($value != 0 && $value != CASE_LOWER && $value != CASE_UPPER)
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="red"> throw new Doctrine_Exception('Field case attribute should be either 0, CASE_LOWER or CASE_UPPER constant.');
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="red"> break;
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="covered"> case Doctrine::ATTR_SEQNAME_FORMAT:
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="covered"> case Doctrine::ATTR_IDXNAME_FORMAT:
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="covered"> case Doctrine::ATTR_TBLNAME_FORMAT:
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="covered"> if ($this instanceof Doctrine_Table) {
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="red"> throw new Doctrine_Exception('Sequence / index name format attributes cannot be set'
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="red"> . 'at table level (only at connection or global level).');
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="red"> default:
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="red"> throw new Doctrine_Exception("Unknown attribute.");
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="covered"> case Doctrine::ATTR_SEQCOL_NAME:
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="covered"> if ( ! is_string($value)) {
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="red"> throw new Doctrine_Exception('Sequence column name attribute only accepts string values');
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="covered"> case Doctrine::ATTR_FIELD_CASE:
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="red"> if ($value != 0 && $value != CASE_LOWER && $value != CASE_UPPER)
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="red"> throw new Doctrine_Exception('Field case attribute should be either 0, CASE_LOWER or CASE_UPPER constant.');
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="red"> break;
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="covered"> case Doctrine::ATTR_SEQNAME_FORMAT:
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="covered"> case Doctrine::ATTR_IDXNAME_FORMAT:
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="covered"> case Doctrine::ATTR_TBLNAME_FORMAT:
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="covered"> if ($this instanceof Doctrine_Table) {
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="red"> throw new Doctrine_Exception('Sequence / index name format attributes cannot be set'
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="red"> . 'at table level (only at connection or global level).');
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="red"> default:
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="red"> throw new Doctrine_Exception("Unknown attribute.");
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="covered"> $this->attributes[$attribute] = $value;
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $this->attributes[$attribute] = $value;
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="normal"> public function getParams($namespace = null)
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<td class="red"> if ($namespace == null) {
|
||||
<td class="normal"> public function getParams($namespace = null)
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<td class="red"> $namespace = $this->getAttribute(Doctrine::ATTR_DEFAULT_PARAM_NAMESPACE);
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>156</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>157</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>158</td>
|
||||
<td class="red"> if ( ! isset($this->_params[$namespace])) {
|
||||
</td></tr>
|
||||
<tr><td>159</td>
|
||||
<td class="red"> return null;
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<td class="red"> return $this->_params[$namespace];
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="normal"> public function getParamNamespaces()
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="red"> return array_keys($this->_params);
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>170</td>
|
||||
<td class="normal"> public function setParam($name, $value, $namespace = null)
|
||||
</td></tr>
|
||||
<tr><td>171</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>172</td>
|
||||
<td class="red"> if ($namespace == null) {
|
||||
</td></tr>
|
||||
<tr><td>173</td>
|
||||
<tr><td>157</td>
|
||||
<td class="red"> $namespace = $this->getAttribute(Doctrine::ATTR_DEFAULT_PARAM_NAMESPACE);
|
||||
</td></tr>
|
||||
<tr><td>174</td>
|
||||
<tr><td>158</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>175</td>
|
||||
<tr><td>159</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<td class="red"> if ( ! isset($this->_params[$namespace])) {
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="red"> return null;
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<td class="red"> return $this->_params[$namespace];
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="normal"> public function getParamNamespaces()
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="red"> return array_keys($this->_params);
|
||||
</td></tr>
|
||||
<tr><td>170</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>171</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>172</td>
|
||||
<td class="normal"> public function setParam($name, $value, $namespace = null)
|
||||
</td></tr>
|
||||
<tr><td>173</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>174</td>
|
||||
<td class="red"> if ($namespace == null) {
|
||||
</td></tr>
|
||||
<tr><td>175</td>
|
||||
<td class="red"> $namespace = $this->getAttribute(Doctrine::ATTR_DEFAULT_PARAM_NAMESPACE);
|
||||
</td></tr>
|
||||
<tr><td>176</td>
|
||||
<td class="red"> $this->_params[$namespace][$name] = $value;
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>177</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>178</td>
|
||||
<td class="red"> return $this;
|
||||
<td class="red"> $this->_params[$namespace][$name] = $value;
|
||||
</td></tr>
|
||||
<tr><td>179</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>180</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>181</td>
|
||||
<td class="normal"> public function getParam($name, $value, $namespace)
|
||||
</td></tr>
|
||||
<tr><td>182</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>183</td>
|
||||
<td class="red"> if ($namespace == null) {
|
||||
</td></tr>
|
||||
<tr><td>184</td>
|
||||
<td class="red"> $namespace = $this->getAttribute(Doctrine::ATTR_DEFAULT_PARAM_NAMESPACE);
|
||||
</td></tr>
|
||||
<tr><td>185</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>186</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>187</td>
|
||||
<td class="red"> if ( ! isset($this->_params[$name])) {
|
||||
<tr><td>180</td>
|
||||
<td class="red"> return $this;
|
||||
</td></tr>
|
||||
<tr><td>188</td>
|
||||
<td class="red"> if (isset($this->parent)) {
|
||||
</td></tr>
|
||||
<tr><td>189</td>
|
||||
<td class="red"> return $this->parent->getParam($name);
|
||||
</td></tr>
|
||||
<tr><td>190</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>191</td>
|
||||
<td class="red"> return null;
|
||||
</td></tr>
|
||||
<tr><td>192</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>193</td>
|
||||
<td class="red"> return $this->_params[$name];
|
||||
</td></tr>
|
||||
<tr><td>194</td>
|
||||
<tr><td>181</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>182</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>183</td>
|
||||
<td class="normal"> public function getParam($name, $value, $namespace)
|
||||
</td></tr>
|
||||
<tr><td>184</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>185</td>
|
||||
<td class="red"> if ($namespace == null) {
|
||||
</td></tr>
|
||||
<tr><td>186</td>
|
||||
<td class="red"> $namespace = $this->getAttribute(Doctrine::ATTR_DEFAULT_PARAM_NAMESPACE);
|
||||
</td></tr>
|
||||
<tr><td>187</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>188</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>189</td>
|
||||
<td class="red"> if ( ! isset($this->_params[$name])) {
|
||||
</td></tr>
|
||||
<tr><td>190</td>
|
||||
<td class="red"> if (isset($this->parent)) {
|
||||
</td></tr>
|
||||
<tr><td>191</td>
|
||||
<td class="red"> return $this->parent->getParam($name);
|
||||
</td></tr>
|
||||
<tr><td>192</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>193</td>
|
||||
<td class="red"> return null;
|
||||
</td></tr>
|
||||
<tr><td>194</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>195</td>
|
||||
<td class="normal"> /**
|
||||
<td class="red"> return $this->_params[$name];
|
||||
</td></tr>
|
||||
<tr><td>196</td>
|
||||
<td class="normal"> * setImpl
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>197</td>
|
||||
<td class="normal"> * binds given class to given template name
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>198</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * setImpl
|
||||
</td></tr>
|
||||
<tr><td>199</td>
|
||||
<td class="normal"> * this method is the base of Doctrine dependency injection
|
||||
<td class="normal"> * binds given class to given template name
|
||||
</td></tr>
|
||||
<tr><td>200</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>201</td>
|
||||
<td class="normal"> * @param string $template name of the class template
|
||||
<td class="normal"> * this method is the base of Doctrine dependency injection
|
||||
</td></tr>
|
||||
<tr><td>202</td>
|
||||
<td class="normal"> * @param string $class name of the class to be bound
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>203</td>
|
||||
<td class="normal"> * @return Doctrine_Configurable this object
|
||||
<td class="normal"> * @param string $template name of the class template
|
||||
</td></tr>
|
||||
<tr><td>204</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @param string $class name of the class to be bound
|
||||
</td></tr>
|
||||
<tr><td>205</td>
|
||||
<td class="normal"> public function setImpl($template, $class)
|
||||
<td class="normal"> * @return Doctrine_Configurable this object
|
||||
</td></tr>
|
||||
<tr><td>206</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>207</td>
|
||||
<td class="covered"> $this->_impl[$template] = $class;
|
||||
<td class="normal"> public function setImpl($template, $class)
|
||||
</td></tr>
|
||||
<tr><td>208</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>209</td>
|
||||
<td class="covered"> return $this;
|
||||
<td class="covered"> $this->_impl[$template] = $class;
|
||||
</td></tr>
|
||||
<tr><td>210</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>211</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> return $this;
|
||||
</td></tr>
|
||||
<tr><td>212</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>213</td>
|
||||
<td class="normal"> * getImpl
|
||||
</td></tr>
|
||||
<tr><td>214</td>
|
||||
<td class="normal"> * returns the implementation for given class
|
||||
</td></tr>
|
||||
<tr><td>215</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>216</td>
|
||||
<td class="normal"> * @return string name of the concrete implementation
|
||||
</td></tr>
|
||||
<tr><td>217</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>218</td>
|
||||
<td class="normal"> public function getImpl($template)
|
||||
</td></tr>
|
||||
<tr><td>219</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>220</td>
|
||||
<td class="covered"> if ( ! isset($this->_impl[$template])) {
|
||||
</td></tr>
|
||||
<tr><td>221</td>
|
||||
<td class="covered"> if (isset($this->parent)) {
|
||||
</td></tr>
|
||||
<tr><td>222</td>
|
||||
<td class="covered"> return $this->parent->getImpl($template);
|
||||
</td></tr>
|
||||
<tr><td>223</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>224</td>
|
||||
<td class="covered"> return null;
|
||||
</td></tr>
|
||||
<tr><td>225</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>226</td>
|
||||
<td class="covered"> return $this->_impl[$template];
|
||||
</td></tr>
|
||||
<tr><td>227</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>228</td>
|
||||
<tr><td>213</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>229</td>
|
||||
<tr><td>214</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>230</td>
|
||||
<td class="normal"> * getCacheDriver
|
||||
<tr><td>215</td>
|
||||
<td class="normal"> * getImpl
|
||||
</td></tr>
|
||||
<tr><td>231</td>
|
||||
<tr><td>216</td>
|
||||
<td class="normal"> * returns the implementation for given class
|
||||
</td></tr>
|
||||
<tr><td>217</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>232</td>
|
||||
<td class="normal"> * @return Doctrine_Cache_Interface
|
||||
<tr><td>218</td>
|
||||
<td class="normal"> * @return string name of the concrete implementation
|
||||
</td></tr>
|
||||
<tr><td>233</td>
|
||||
<tr><td>219</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>234</td>
|
||||
<td class="normal"> public function getCacheDriver()
|
||||
<tr><td>220</td>
|
||||
<td class="normal"> public function getImpl($template)
|
||||
</td></tr>
|
||||
<tr><td>235</td>
|
||||
<tr><td>221</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>236</td>
|
||||
<td class="covered"> if ( ! isset($this->attributes[Doctrine::ATTR_CACHE])) {
|
||||
<tr><td>222</td>
|
||||
<td class="covered"> if ( ! isset($this->_impl[$template])) {
|
||||
</td></tr>
|
||||
<tr><td>237</td>
|
||||
<td class="red"> throw new Doctrine_Exception('Cache driver not initialized.');
|
||||
<tr><td>223</td>
|
||||
<td class="covered"> if (isset($this->parent)) {
|
||||
</td></tr>
|
||||
<tr><td>238</td>
|
||||
<tr><td>224</td>
|
||||
<td class="covered"> return $this->parent->getImpl($template);
|
||||
</td></tr>
|
||||
<tr><td>225</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>226</td>
|
||||
<td class="covered"> return null;
|
||||
</td></tr>
|
||||
<tr><td>227</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>228</td>
|
||||
<td class="covered"> return $this->_impl[$template];
|
||||
</td></tr>
|
||||
<tr><td>229</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>230</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>231</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>232</td>
|
||||
<td class="normal"> public function hasImpl($template)
|
||||
</td></tr>
|
||||
<tr><td>233</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>234</td>
|
||||
<td class="red"> if ( ! isset($this->_impl[$template])) {
|
||||
</td></tr>
|
||||
<tr><td>235</td>
|
||||
<td class="red"> if (isset($this->parent)) {
|
||||
</td></tr>
|
||||
<tr><td>236</td>
|
||||
<td class="red"> return $this->parent->hasImpl($template);
|
||||
</td></tr>
|
||||
<tr><td>237</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>238</td>
|
||||
<td class="red"> return false;
|
||||
</td></tr>
|
||||
<tr><td>239</td>
|
||||
<td class="normal">
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>240</td>
|
||||
<td class="covered"> return $this->attributes[Doctrine::ATTR_CACHE];
|
||||
<td class="red"> return true;
|
||||
</td></tr>
|
||||
<tr><td>241</td>
|
||||
<td class="orange"> }
|
||||
@ -1117,132 +1117,135 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>370</td>
|
||||
<td class="covered"> if ( ! isset($this->attributes[$attribute])) {
|
||||
<td class="covered"> if (isset($this->attributes[$attribute])) {
|
||||
</td></tr>
|
||||
<tr><td>371</td>
|
||||
<td class="covered"> if (isset($this->parent)) {
|
||||
<td class="covered"> return $this->attributes[$attribute];
|
||||
</td></tr>
|
||||
<tr><td>372</td>
|
||||
<td class="covered"> return $this->parent->getAttribute($attribute);
|
||||
</td></tr>
|
||||
<tr><td>373</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>374</td>
|
||||
<td class="covered"> return null;
|
||||
</td></tr>
|
||||
<tr><td>375</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>373</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>374</td>
|
||||
<td class="covered"> if (isset($this->parent)) {
|
||||
</td></tr>
|
||||
<tr><td>375</td>
|
||||
<td class="covered"> return $this->parent->getAttribute($attribute);
|
||||
</td></tr>
|
||||
<tr><td>376</td>
|
||||
<td class="covered"> return $this->attributes[$attribute];
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>377</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> return null;
|
||||
</td></tr>
|
||||
<tr><td>378</td>
|
||||
<td class="normal">
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>379</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>380</td>
|
||||
<td class="normal"> * getAttributes
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>381</td>
|
||||
<td class="normal"> * returns all attributes as an array
|
||||
<td class="normal"> * getAttributes
|
||||
</td></tr>
|
||||
<tr><td>382</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * returns all attributes as an array
|
||||
</td></tr>
|
||||
<tr><td>383</td>
|
||||
<td class="normal"> * @return array
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>384</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @return array
|
||||
</td></tr>
|
||||
<tr><td>385</td>
|
||||
<td class="normal"> public function getAttributes()
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>386</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> public function getAttributes()
|
||||
</td></tr>
|
||||
<tr><td>387</td>
|
||||
<td class="red"> return $this->attributes;
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>388</td>
|
||||
<td class="orange"> }
|
||||
<td class="red"> return $this->attributes;
|
||||
</td></tr>
|
||||
<tr><td>389</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>390</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>391</td>
|
||||
<td class="normal"> * sets a parent for this configurable component
|
||||
</td></tr>
|
||||
<tr><td>392</td>
|
||||
<td class="normal"> * the parent must be configurable component itself
|
||||
</td></tr>
|
||||
<tr><td>393</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>394</td>
|
||||
<td class="normal"> * @param Doctrine_Configurable $component
|
||||
</td></tr>
|
||||
<tr><td>395</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>396</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>397</td>
|
||||
<td class="normal"> public function setParent(Doctrine_Configurable $component)
|
||||
</td></tr>
|
||||
<tr><td>398</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>399</td>
|
||||
<td class="covered"> $this->parent = $component;
|
||||
</td></tr>
|
||||
<tr><td>400</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>401</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>402</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>403</td>
|
||||
<td class="normal"> * getParent
|
||||
</td></tr>
|
||||
<tr><td>404</td>
|
||||
<td class="normal"> * returns the parent of this component
|
||||
</td></tr>
|
||||
<tr><td>405</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>406</td>
|
||||
<td class="normal"> * @return Doctrine_Configurable
|
||||
</td></tr>
|
||||
<tr><td>407</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>408</td>
|
||||
<td class="normal"> public function getParent()
|
||||
</td></tr>
|
||||
<tr><td>409</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>410</td>
|
||||
<td class="covered"> return $this->parent;
|
||||
</td></tr>
|
||||
<tr><td>411</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>390</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>391</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>392</td>
|
||||
<td class="normal"> * sets a parent for this configurable component
|
||||
</td></tr>
|
||||
<tr><td>393</td>
|
||||
<td class="normal"> * the parent must be configurable component itself
|
||||
</td></tr>
|
||||
<tr><td>394</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>395</td>
|
||||
<td class="normal"> * @param Doctrine_Configurable $component
|
||||
</td></tr>
|
||||
<tr><td>396</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>397</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>398</td>
|
||||
<td class="normal"> public function setParent(Doctrine_Configurable $component)
|
||||
</td></tr>
|
||||
<tr><td>399</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>400</td>
|
||||
<td class="covered"> $this->parent = $component;
|
||||
</td></tr>
|
||||
<tr><td>401</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>402</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>403</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>404</td>
|
||||
<td class="normal"> * getParent
|
||||
</td></tr>
|
||||
<tr><td>405</td>
|
||||
<td class="normal"> * returns the parent of this component
|
||||
</td></tr>
|
||||
<tr><td>406</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>407</td>
|
||||
<td class="normal"> * @return Doctrine_Configurable
|
||||
</td></tr>
|
||||
<tr><td>408</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>409</td>
|
||||
<td class="normal"> public function getParent()
|
||||
</td></tr>
|
||||
<tr><td>410</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>411</td>
|
||||
<td class="covered"> return $this->parent;
|
||||
</td></tr>
|
||||
<tr><td>412</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>413</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Mysql.php 3070 2007-11-03 15:47:24Z zYne $
|
||||
<td class="normal"> * $Id: Mysql.php 3183 2007-11-18 16:06:37Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 3070 $
|
||||
<td class="normal"> * @version $Revision: 3183 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @link www.phpdoctrine.com
|
||||
@ -514,7 +514,7 @@
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="normal"> public function replace($table, array $fields, array $keys)
|
||||
<td class="normal"> public function replace(Doctrine_Table $table, array $fields, array $keys)
|
||||
</td></tr>
|
||||
<tr><td>170</td>
|
||||
<td class="normal"> {
|
||||
@ -556,7 +556,7 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>183</td>
|
||||
<td class="red"> $query .= $name;
|
||||
<td class="red"> $query .= $table->getColumnName($name);
|
||||
</td></tr>
|
||||
<tr><td>184</td>
|
||||
<td class="normal">
|
||||
@ -622,7 +622,7 @@
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>205</td>
|
||||
<td class="red"> $query = 'REPLACE INTO ' . $table . ' (' . $query . ') VALUES (' . $values . ')';
|
||||
<td class="red"> $query = 'REPLACE INTO ' . $table->getTableName() . ' (' . $query . ') VALUES (' . $values . ')';
|
||||
</td></tr>
|
||||
<tr><td>206</td>
|
||||
<td class="normal">
|
||||
|
@ -502,7 +502,7 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="red"> return array_pop($this->events);
|
||||
<td class="covered"> return array_pop($this->events);
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="orange"> }
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Oracle.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: Oracle.php 3159 2007-11-15 05:16:31Z Jonathan.Wage $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -88,7 +88,7 @@
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
</td></tr>
|
||||
<tr><td>27</td>
|
||||
<td class="normal"> * @version $Revision: 2963 $
|
||||
<td class="normal"> * @version $Revision: 3159 $
|
||||
</td></tr>
|
||||
<tr><td>28</td>
|
||||
<td class="normal"> * @link www.phpdoctrine.com
|
||||
@ -337,31 +337,31 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="covered"> $dbType = strtolower($field['type']);
|
||||
<td class="covered"> if ( ! isset($field['data_type'])) {
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="covered"> $type = array();
|
||||
<td class="red"> throw new Doctrine_DataDict_Exception('Native oracle definition must have a data_type key specified');
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="covered"> $length = $unsigned = $fixed = null;
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="covered"> if ( ! empty($field['length'])) {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="covered"> $length = $field['length'];
|
||||
<td class="covered"> $dbType = strtolower($field['data_type']);
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $type = array();
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $length = $unsigned = $fixed = null;
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="covered"> if ( ! isset($field['name'])) {
|
||||
<td class="covered"> if ( ! empty($field['data_length'])) {
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="covered"> $field['name'] = '';
|
||||
<td class="covered"> $length = $field['data_length'];
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="covered"> }
|
||||
@ -370,227 +370,240 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="normal"> switch ($dbType) {
|
||||
<td class="covered"> if ( ! isset($field['column_name'])) {
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="covered"> case 'integer':
|
||||
<td class="covered"> $field['column_name'] = '';
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="covered"> case 'pls_integer':
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="covered"> case 'binary_integer':
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="covered"> $type[] = 'integer';
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="covered"> if ($length == '1') {
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="covered"> $type[] = 'boolean';
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> if (preg_match('/^(is|has)/', $field['name'])) {
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="red"> $type = array_reverse($type);
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="covered"> case 'varchar':
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="covered"> case 'varchar2':
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="covered"> case 'nvarchar2':
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="covered"> $fixed = false;
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="covered"> case 'char':
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="covered"> case 'nchar':
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="covered"> $type[] = 'string';
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="covered"> if ($length == '1') {
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="covered"> $type[] = 'boolean';
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="covered"> if (preg_match('/^(is|has)/', $field['name'])) {
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="red"> $type = array_reverse($type);
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="covered"> if ($fixed !== false) {
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="covered"> $fixed = true;
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="covered"> case 'date':
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="covered"> case 'timestamp':
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="covered"> $type[] = 'timestamp';
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="covered"> $length = null;
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<td class="covered"> case 'float':
|
||||
</td></tr>
|
||||
<tr><td>156</td>
|
||||
<td class="covered"> $type[] = 'float';
|
||||
</td></tr>
|
||||
<tr><td>157</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>158</td>
|
||||
<td class="covered"> case 'number':
|
||||
</td></tr>
|
||||
<tr><td>159</td>
|
||||
<td class="covered"> if ( ! empty($field['scale'])) {
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<td class="red"> $type[] = 'decimal';
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<td class="covered"> $type[] = 'integer';
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="covered"> if ($length == '1') {
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<td class="covered"> $type[] = 'boolean';
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="covered"> if (preg_match('/^(is|has)/', $field['name'])) {
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="red"> $type = array_reverse($type);
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>170</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>171</td>
|
||||
<td class="covered"> case 'long':
|
||||
</td></tr>
|
||||
<tr><td>172</td>
|
||||
<td class="covered"> $type[] = 'string';
|
||||
</td></tr>
|
||||
<tr><td>173</td>
|
||||
<td class="covered"> case 'clob':
|
||||
</td></tr>
|
||||
<tr><td>174</td>
|
||||
<td class="covered"> case 'nclob':
|
||||
</td></tr>
|
||||
<tr><td>175</td>
|
||||
<td class="covered"> $type[] = 'clob';
|
||||
</td></tr>
|
||||
<tr><td>176</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>177</td>
|
||||
<td class="covered"> case 'blob':
|
||||
</td></tr>
|
||||
<tr><td>178</td>
|
||||
<td class="covered"> case 'raw':
|
||||
</td></tr>
|
||||
<tr><td>179</td>
|
||||
<td class="covered"> case 'long raw':
|
||||
</td></tr>
|
||||
<tr><td>180</td>
|
||||
<td class="covered"> case 'bfile':
|
||||
</td></tr>
|
||||
<tr><td>181</td>
|
||||
<td class="covered"> $type[] = 'blob';
|
||||
</td></tr>
|
||||
<tr><td>182</td>
|
||||
<td class="covered"> $length = null;
|
||||
</td></tr>
|
||||
<tr><td>183</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>184</td>
|
||||
<td class="covered"> case 'rowid':
|
||||
</td></tr>
|
||||
<tr><td>185</td>
|
||||
<td class="covered"> case 'urowid':
|
||||
</td></tr>
|
||||
<tr><td>186</td>
|
||||
<td class="covered"> default:
|
||||
</td></tr>
|
||||
<tr><td>187</td>
|
||||
<td class="covered"> throw new Doctrine_DataDict_Exception('unknown database attribute type: ' . $dbType);
|
||||
</td></tr>
|
||||
<tr><td>188</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>189</td>
|
||||
<tr><td>124</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="normal"> switch ($dbType) {
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="covered"> case 'integer':
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="covered"> case 'pls_integer':
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> case 'binary_integer':
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="covered"> $type[] = 'integer';
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="covered"> if ($length == '1') {
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="covered"> $type[] = 'boolean';
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="covered"> if (preg_match('/^(is|has)/', $field['column_name'])) {
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="red"> $type = array_reverse($type);
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="covered"> case 'varchar':
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="covered"> case 'varchar2':
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="covered"> case 'nvarchar2':
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="covered"> $fixed = false;
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="covered"> case 'char':
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="covered"> case 'nchar':
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="covered"> $type[] = 'string';
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="covered"> if ($length == '1') {
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="covered"> $type[] = 'boolean';
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="covered"> if (preg_match('/^(is|has)/', $field['column_name'])) {
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="red"> $type = array_reverse($type);
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="covered"> if ($fixed !== false) {
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="covered"> $fixed = true;
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<td class="covered"> case 'date':
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<td class="covered"> case 'timestamp':
|
||||
</td></tr>
|
||||
<tr><td>156</td>
|
||||
<td class="covered"> $type[] = 'timestamp';
|
||||
</td></tr>
|
||||
<tr><td>157</td>
|
||||
<td class="covered"> $length = null;
|
||||
</td></tr>
|
||||
<tr><td>158</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>159</td>
|
||||
<td class="covered"> case 'float':
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<td class="covered"> $type[] = 'float';
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<td class="covered"> case 'number':
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="covered"> if ( ! empty($field['data_scale'])) {
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<td class="red"> $type[] = 'decimal';
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="covered"> $type[] = 'integer';
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="covered"> if ($length == '1') {
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<td class="covered"> $type[] = 'boolean';
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="covered"> if (preg_match('/^(is|has)/', $field['column_name'])) {
|
||||
</td></tr>
|
||||
<tr><td>170</td>
|
||||
<td class="red"> $type = array_reverse($type);
|
||||
</td></tr>
|
||||
<tr><td>171</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>172</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>173</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>174</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>175</td>
|
||||
<td class="covered"> case 'long':
|
||||
</td></tr>
|
||||
<tr><td>176</td>
|
||||
<td class="covered"> $type[] = 'string';
|
||||
</td></tr>
|
||||
<tr><td>177</td>
|
||||
<td class="covered"> case 'clob':
|
||||
</td></tr>
|
||||
<tr><td>178</td>
|
||||
<td class="covered"> case 'nclob':
|
||||
</td></tr>
|
||||
<tr><td>179</td>
|
||||
<td class="covered"> $type[] = 'clob';
|
||||
</td></tr>
|
||||
<tr><td>180</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>181</td>
|
||||
<td class="covered"> case 'blob':
|
||||
</td></tr>
|
||||
<tr><td>182</td>
|
||||
<td class="covered"> case 'raw':
|
||||
</td></tr>
|
||||
<tr><td>183</td>
|
||||
<td class="covered"> case 'long raw':
|
||||
</td></tr>
|
||||
<tr><td>184</td>
|
||||
<td class="covered"> case 'bfile':
|
||||
</td></tr>
|
||||
<tr><td>185</td>
|
||||
<td class="covered"> $type[] = 'blob';
|
||||
</td></tr>
|
||||
<tr><td>186</td>
|
||||
<td class="covered"> $length = null;
|
||||
</td></tr>
|
||||
<tr><td>187</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>188</td>
|
||||
<td class="covered"> case 'rowid':
|
||||
</td></tr>
|
||||
<tr><td>189</td>
|
||||
<td class="covered"> case 'urowid':
|
||||
</td></tr>
|
||||
<tr><td>190</td>
|
||||
<td class="covered"> return array('type' => $type,
|
||||
<td class="covered"> default:
|
||||
</td></tr>
|
||||
<tr><td>191</td>
|
||||
<td class="covered"> 'length' => $length,
|
||||
<td class="covered"> throw new Doctrine_DataDict_Exception('unknown database attribute type: ' . $dbType);
|
||||
</td></tr>
|
||||
<tr><td>192</td>
|
||||
<td class="covered"> 'unsigned' => $unsigned,
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>193</td>
|
||||
<td class="covered"> 'fixed' => $fixed);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>194</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> return array('type' => $type,
|
||||
</td></tr>
|
||||
<tr><td>195</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<td class="covered"> 'length' => $length,
|
||||
</td></tr>
|
||||
<tr><td>196</td>
|
||||
<td class="covered"> 'unsigned' => $unsigned,
|
||||
</td></tr>
|
||||
<tr><td>197</td>
|
||||
<td class="covered"> 'fixed' => $fixed);
|
||||
</td></tr>
|
||||
<tr><td>198</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>199</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -955,16 +955,16 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>316</td>
|
||||
<td class="red"> foreach ($this->_listeners as $listener) {
|
||||
<td class="covered"> foreach ($this->_listeners as $listener) {
|
||||
</td></tr>
|
||||
<tr><td>317</td>
|
||||
<td class="red"> $listener->preQuery($event);
|
||||
<td class="covered"> $listener->preQuery($event);
|
||||
</td></tr>
|
||||
<tr><td>318</td>
|
||||
<td class="red"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>319</td>
|
||||
<td class="red"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>320</td>
|
||||
<td class="normal"> public function postQuery(Doctrine_Event $event)
|
||||
@ -973,16 +973,16 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>322</td>
|
||||
<td class="red"> foreach ($this->_listeners as $listener) {
|
||||
<td class="covered"> foreach ($this->_listeners as $listener) {
|
||||
</td></tr>
|
||||
<tr><td>323</td>
|
||||
<td class="red"> $listener->postQuery($event);
|
||||
<td class="covered"> $listener->postQuery($event);
|
||||
</td></tr>
|
||||
<tr><td>324</td>
|
||||
<td class="red"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>325</td>
|
||||
<td class="red"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>326</td>
|
||||
<td class="normal">
|
||||
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Export.php 3088 2007-11-08 18:52:08Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: Export.php 3149 2007-11-13 22:28:37Z zYne $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -103,7 +103,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>32</td>
|
||||
<td class="normal"> * @version $Revision: 3088 $
|
||||
<td class="normal"> * @version $Revision: 3149 $
|
||||
</td></tr>
|
||||
<tr><td>33</td>
|
||||
<td class="normal"> */
|
||||
@ -817,7 +817,7 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>270</td>
|
||||
<td class="red"> foreach ((array) $options['foreignKeys'] as $k => $definition) {
|
||||
<td class="covered"> foreach ((array) $options['foreignKeys'] as $k => $definition) {
|
||||
</td></tr>
|
||||
<tr><td>271</td>
|
||||
<td class="red"> if (is_array($definition)) {
|
||||
@ -832,7 +832,7 @@
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>275</td>
|
||||
<td class="red"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>276</td>
|
||||
<td class="covered"> return $sql;
|
||||
@ -3409,338 +3409,438 @@
|
||||
<td class="covered"> $table = $record->getTable();
|
||||
</td></tr>
|
||||
<tr><td>1134</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1135</td>
|
||||
<td class="covered"> $data = $table->getExportableFormat();
|
||||
<td class="covered"> $parents = $table->getOption('joinedParents');
|
||||
</td></tr>
|
||||
<tr><td>1136</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1137</td>
|
||||
<td class="covered"> $query = $this->conn->export->createTableSql($data['tableName'], $data['columns'], $data['options']);
|
||||
<td class="covered"> foreach ($parents as $parent) {
|
||||
</td></tr>
|
||||
<tr><td>1138</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $data = $table->getConnection()->getTable($parent)->getExportableFormat();
|
||||
</td></tr>
|
||||
<tr><td>1139</td>
|
||||
<td class="covered"> if (is_array($query)) {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1140</td>
|
||||
<td class="covered"> $sql = array_merge($sql, $query);
|
||||
</td></tr>
|
||||
<tr><td>1141</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>1142</td>
|
||||
<td class="red"> $sql[] = $query;
|
||||
</td></tr>
|
||||
<tr><td>1143</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>1144</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1145</td>
|
||||
<td class="covered"> if ($table->getAttribute(Doctrine::ATTR_EXPORT) & Doctrine::EXPORT_PLUGINS) {
|
||||
</td></tr>
|
||||
<tr><td>1146</td>
|
||||
<td class="covered"> $sql = array_merge($sql, $this->exportPluginsSql($table));
|
||||
</td></tr>
|
||||
<tr><td>1147</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>1148</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>1149</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1150</td>
|
||||
<td class="covered"> $sql = array_unique($sql);
|
||||
</td></tr>
|
||||
<tr><td>1151</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1152</td>
|
||||
<td class="covered"> rsort($sql);
|
||||
</td></tr>
|
||||
<tr><td>1153</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1154</td>
|
||||
<td class="covered"> return $sql;
|
||||
</td></tr>
|
||||
<tr><td>1155</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>1156</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1157</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>1158</td>
|
||||
<td class="normal"> * exportPluginsSql
|
||||
</td></tr>
|
||||
<tr><td>1159</td>
|
||||
<td class="normal"> * exports plugin tables for given table
|
||||
</td></tr>
|
||||
<tr><td>1160</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>1161</td>
|
||||
<td class="normal"> * @param Doctrine_Table $table the table in which the plugins belong to
|
||||
</td></tr>
|
||||
<tr><td>1162</td>
|
||||
<td class="normal"> * @return array an array of sql strings
|
||||
</td></tr>
|
||||
<tr><td>1163</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>1164</td>
|
||||
<td class="normal"> public function exportPluginsSql(Doctrine_Table $table)
|
||||
</td></tr>
|
||||
<tr><td>1165</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>1166</td>
|
||||
<td class="covered"> $sql = array();
|
||||
</td></tr>
|
||||
<tr><td>1167</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1168</td>
|
||||
<td class="covered"> foreach ($table->getTemplates() as $name => $template) {
|
||||
</td></tr>
|
||||
<tr><td>1169</td>
|
||||
<td class="covered"> $plugin = $template->getPlugin();
|
||||
</td></tr>
|
||||
<tr><td>1170</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1171</td>
|
||||
<td class="covered"> if ($plugin === null) {
|
||||
</td></tr>
|
||||
<tr><td>1172</td>
|
||||
<td class="covered"> continue;
|
||||
</td></tr>
|
||||
<tr><td>1173</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>1174</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1175</td>
|
||||
<td class="covered"> $table = $plugin->getOption('pluginTable');
|
||||
</td></tr>
|
||||
<tr><td>1176</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1177</td>
|
||||
<td class="normal"> // Make sure plugin has a valid table
|
||||
</td></tr>
|
||||
<tr><td>1178</td>
|
||||
<td class="covered"> if ($table instanceof Doctrine_Table) {
|
||||
</td></tr>
|
||||
<tr><td>1179</td>
|
||||
<td class="covered"> $data = $table->getExportableFormat();
|
||||
</td></tr>
|
||||
<tr><td>1180</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1181</td>
|
||||
<td class="covered"> $query = $this->conn->export->createTableSql($data['tableName'], $data['columns'], $data['options']);
|
||||
</td></tr>
|
||||
<tr><td>1182</td>
|
||||
<td class="normal">
|
||||
<tr><td>1141</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1183</td>
|
||||
<tr><td>1142</td>
|
||||
<td class="covered"> $sql = array_merge($sql, (array) $query);
|
||||
</td></tr>
|
||||
<tr><td>1184</td>
|
||||
<tr><td>1143</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>1185</td>
|
||||
<tr><td>1144</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1145</td>
|
||||
<td class="covered"> $data = $table->getExportableFormat();
|
||||
</td></tr>
|
||||
<tr><td>1146</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1147</td>
|
||||
<td class="covered"> $query = $this->conn->export->createTableSql($data['tableName'], $data['columns'], $data['options']);
|
||||
</td></tr>
|
||||
<tr><td>1148</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1149</td>
|
||||
<td class="covered"> if (is_array($query)) {
|
||||
</td></tr>
|
||||
<tr><td>1150</td>
|
||||
<td class="covered"> $sql = array_merge($sql, $query);
|
||||
</td></tr>
|
||||
<tr><td>1151</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>1152</td>
|
||||
<td class="red"> $sql[] = $query;
|
||||
</td></tr>
|
||||
<tr><td>1153</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>1154</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1155</td>
|
||||
<td class="covered"> if ($table->getAttribute(Doctrine::ATTR_EXPORT) & Doctrine::EXPORT_PLUGINS) {
|
||||
</td></tr>
|
||||
<tr><td>1156</td>
|
||||
<td class="covered"> $sql = array_merge($sql, $this->exportPluginsSql($table));
|
||||
</td></tr>
|
||||
<tr><td>1157</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>1158</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>1186</td>
|
||||
<tr><td>1159</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1160</td>
|
||||
<td class="covered"> $sql = array_unique($sql);
|
||||
</td></tr>
|
||||
<tr><td>1161</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1162</td>
|
||||
<td class="covered"> rsort($sql);
|
||||
</td></tr>
|
||||
<tr><td>1163</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1187</td>
|
||||
<tr><td>1164</td>
|
||||
<td class="covered"> return $sql;
|
||||
</td></tr>
|
||||
<tr><td>1188</td>
|
||||
<tr><td>1165</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>1189</td>
|
||||
<tr><td>1166</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1190</td>
|
||||
<tr><td>1167</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>1168</td>
|
||||
<td class="normal"> * fetches all plugins recursively for given table
|
||||
</td></tr>
|
||||
<tr><td>1169</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>1170</td>
|
||||
<td class="normal"> * @param Doctrine_Table $table table object to retrieve the plugins from
|
||||
</td></tr>
|
||||
<tr><td>1171</td>
|
||||
<td class="normal"> * @return array an array of Doctrine_Plugin objects
|
||||
</td></tr>
|
||||
<tr><td>1172</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>1173</td>
|
||||
<td class="normal"> public function getAllPlugins(Doctrine_Table $table)
|
||||
</td></tr>
|
||||
<tr><td>1174</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>1175</td>
|
||||
<td class="covered"> $plugins = array();
|
||||
</td></tr>
|
||||
<tr><td>1176</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1177</td>
|
||||
<td class="covered"> foreach ($table->getTemplates() as $name => $template) {
|
||||
</td></tr>
|
||||
<tr><td>1178</td>
|
||||
<td class="covered"> $plugin = $template->getPlugin();
|
||||
</td></tr>
|
||||
<tr><td>1179</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1180</td>
|
||||
<td class="covered"> if ($plugin === null) {
|
||||
</td></tr>
|
||||
<tr><td>1181</td>
|
||||
<td class="covered"> continue;
|
||||
</td></tr>
|
||||
<tr><td>1182</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>1183</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1184</td>
|
||||
<td class="covered"> $plugins[] = $plugin;
|
||||
</td></tr>
|
||||
<tr><td>1185</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1186</td>
|
||||
<td class="covered"> $pluginTable = $plugin->getOption('pluginTable');
|
||||
</td></tr>
|
||||
<tr><td>1187</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1188</td>
|
||||
<td class="covered"> if ($pluginTable instanceof Doctrine_Table) {
|
||||
</td></tr>
|
||||
<tr><td>1189</td>
|
||||
<td class="covered"> $plugins = array_merge($plugins, $this->getAllPlugins($pluginTable));
|
||||
</td></tr>
|
||||
<tr><td>1190</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>1191</td>
|
||||
<td class="normal"> * exportSql
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>1192</td>
|
||||
<td class="normal"> * returns the sql for exporting Doctrine_Record classes to a schema
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1193</td>
|
||||
<td class="normal"> *
|
||||
<td class="covered"> return $plugins;
|
||||
</td></tr>
|
||||
<tr><td>1194</td>
|
||||
<td class="normal"> * if the directory parameter is given this method first iterates
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>1195</td>
|
||||
<td class="normal"> * recursively trhough the given directory in order to find any model classes
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1196</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>1197</td>
|
||||
<td class="normal"> * Then it iterates through all declared classes and creates tables for the ones
|
||||
<td class="normal"> * exportPluginsSql
|
||||
</td></tr>
|
||||
<tr><td>1198</td>
|
||||
<td class="normal"> * that extend Doctrine_Record and are not abstract classes
|
||||
<td class="normal"> * exports plugin tables for given table
|
||||
</td></tr>
|
||||
<tr><td>1199</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>1200</td>
|
||||
<td class="normal"> * @throws Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS
|
||||
<td class="normal"> * @param Doctrine_Table $table the table in which the plugins belong to
|
||||
</td></tr>
|
||||
<tr><td>1201</td>
|
||||
<td class="normal"> * occurred during the create table operation
|
||||
<td class="normal"> * @return array an array of sql strings
|
||||
</td></tr>
|
||||
<tr><td>1202</td>
|
||||
<td class="normal"> * @param string $directory optional directory parameter
|
||||
</td></tr>
|
||||
<tr><td>1203</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>1204</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>1205</td>
|
||||
<td class="normal"> public function exportSql($directory = null)
|
||||
<tr><td>1203</td>
|
||||
<td class="normal"> public function exportPluginsSql(Doctrine_Table $table)
|
||||
</td></tr>
|
||||
<tr><td>1206</td>
|
||||
<tr><td>1204</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>1205</td>
|
||||
<td class="covered"> $sql = array();
|
||||
</td></tr>
|
||||
<tr><td>1206</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1207</td>
|
||||
<td class="red"> if ($directory !== null) {
|
||||
<td class="covered"> foreach ($this->getAllPlugins($table) as $name => $plugin) {
|
||||
</td></tr>
|
||||
<tr><td>1208</td>
|
||||
<td class="red"> $models = Doctrine::loadModels($directory);
|
||||
<td class="covered"> $table = $plugin->getOption('pluginTable');
|
||||
</td></tr>
|
||||
<tr><td>1209</td>
|
||||
<td class="red"> } else {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1210</td>
|
||||
<td class="red"> $models = Doctrine::getLoadedModels();
|
||||
<td class="normal"> // Make sure plugin has a valid table
|
||||
</td></tr>
|
||||
<tr><td>1211</td>
|
||||
<td class="normal"> }
|
||||
<td class="covered"> if ($table instanceof Doctrine_Table) {
|
||||
</td></tr>
|
||||
<tr><td>1212</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $data = $table->getExportableFormat();
|
||||
</td></tr>
|
||||
<tr><td>1213</td>
|
||||
<td class="red"> return $this->exportClassesSql($models);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1214</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> $query = $this->conn->export->createTableSql($data['tableName'], $data['columns'], $data['options']);
|
||||
</td></tr>
|
||||
<tr><td>1215</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1216</td>
|
||||
<td class="normal"> /**
|
||||
<td class="covered"> $sql = array_merge($sql, (array) $query);
|
||||
</td></tr>
|
||||
<tr><td>1217</td>
|
||||
<td class="normal"> * exportTable
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>1218</td>
|
||||
<td class="normal"> * exports given table into database based on column and option definitions
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>1219</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1220</td>
|
||||
<td class="normal"> * @throws Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS
|
||||
<td class="covered"> return $sql;
|
||||
</td></tr>
|
||||
<tr><td>1221</td>
|
||||
<td class="normal"> * occurred during the create table operation
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>1222</td>
|
||||
<td class="normal"> * @return boolean whether or not the export operation was successful
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1223</td>
|
||||
<td class="normal"> * false if table already existed in the database
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>1224</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * exportSql
|
||||
</td></tr>
|
||||
<tr><td>1225</td>
|
||||
<td class="normal"> public function exportTable(Doctrine_Table $table)
|
||||
<td class="normal"> * returns the sql for exporting Doctrine_Record classes to a schema
|
||||
</td></tr>
|
||||
<tr><td>1226</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>1227</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal"> * if the directory parameter is given this method first iterates
|
||||
</td></tr>
|
||||
<tr><td>1228</td>
|
||||
<td class="normal"> TODO: maybe there should be portability option for the following check
|
||||
<td class="normal"> * recursively trhough the given directory in order to find any model classes
|
||||
</td></tr>
|
||||
<tr><td>1229</td>
|
||||
<td class="normal"> if ( ! Doctrine::isValidClassname($table->getOption('declaringClass')->getName())) {
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>1230</td>
|
||||
<td class="normal"> throw new Doctrine_Export_Exception('Class name not valid.');
|
||||
<td class="normal"> * Then it iterates through all declared classes and creates tables for the ones
|
||||
</td></tr>
|
||||
<tr><td>1231</td>
|
||||
<td class="normal"> }
|
||||
<td class="normal"> * that extend Doctrine_Record and are not abstract classes
|
||||
</td></tr>
|
||||
<tr><td>1232</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>1233</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> * @throws Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS
|
||||
</td></tr>
|
||||
<tr><td>1234</td>
|
||||
<td class="normal"> try {
|
||||
<td class="normal"> * occurred during the create table operation
|
||||
</td></tr>
|
||||
<tr><td>1235</td>
|
||||
<td class="red"> $data = $table->getExportableFormat();
|
||||
<td class="normal"> * @param string $directory optional directory parameter
|
||||
</td></tr>
|
||||
<tr><td>1236</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>1237</td>
|
||||
<td class="red"> $this->conn->export->createTable($data['tableName'], $data['columns'], $data['options']);
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>1238</td>
|
||||
<td class="red"> } catch(Doctrine_Connection_Exception $e) {
|
||||
<td class="normal"> public function exportSql($directory = null)
|
||||
</td></tr>
|
||||
<tr><td>1239</td>
|
||||
<td class="normal"> // we only want to silence table already exists errors
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>1240</td>
|
||||
<td class="orange"> if ($e->getPortableCode() !== Doctrine::ERR_ALREADY_EXISTS) {
|
||||
<td class="red"> if ($directory !== null) {
|
||||
</td></tr>
|
||||
<tr><td>1241</td>
|
||||
<td class="orange"> throw $e;
|
||||
<td class="red"> $models = Doctrine::loadModels($directory);
|
||||
</td></tr>
|
||||
<tr><td>1242</td>
|
||||
<td class="orange"> }
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>1243</td>
|
||||
<td class="normal"> }
|
||||
<td class="red"> $models = Doctrine::getLoadedModels();
|
||||
</td></tr>
|
||||
<tr><td>1244</td>
|
||||
<td class="red"> }
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>1245</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1246</td>
|
||||
<td class="red"> return $this->exportClassesSql($models);
|
||||
</td></tr>
|
||||
<tr><td>1247</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>1248</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1249</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>1250</td>
|
||||
<td class="normal"> * exportTable
|
||||
</td></tr>
|
||||
<tr><td>1251</td>
|
||||
<td class="normal"> * exports given table into database based on column and option definitions
|
||||
</td></tr>
|
||||
<tr><td>1252</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>1253</td>
|
||||
<td class="normal"> * @throws Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS
|
||||
</td></tr>
|
||||
<tr><td>1254</td>
|
||||
<td class="normal"> * occurred during the create table operation
|
||||
</td></tr>
|
||||
<tr><td>1255</td>
|
||||
<td class="normal"> * @return boolean whether or not the export operation was successful
|
||||
</td></tr>
|
||||
<tr><td>1256</td>
|
||||
<td class="normal"> * false if table already existed in the database
|
||||
</td></tr>
|
||||
<tr><td>1257</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>1258</td>
|
||||
<td class="normal"> public function exportTable(Doctrine_Table $table)
|
||||
</td></tr>
|
||||
<tr><td>1259</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>1260</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>1261</td>
|
||||
<td class="normal"> TODO: maybe there should be portability option for the following check
|
||||
</td></tr>
|
||||
<tr><td>1262</td>
|
||||
<td class="normal"> if ( ! Doctrine::isValidClassname($table->getOption('declaringClass')->getName())) {
|
||||
</td></tr>
|
||||
<tr><td>1263</td>
|
||||
<td class="normal"> throw new Doctrine_Export_Exception('Class name not valid.');
|
||||
</td></tr>
|
||||
<tr><td>1264</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>1265</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>1266</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1267</td>
|
||||
<td class="normal"> try {
|
||||
</td></tr>
|
||||
<tr><td>1268</td>
|
||||
<td class="red"> $data = $table->getExportableFormat();
|
||||
</td></tr>
|
||||
<tr><td>1269</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>1270</td>
|
||||
<td class="red"> $this->conn->export->createTable($data['tableName'], $data['columns'], $data['options']);
|
||||
</td></tr>
|
||||
<tr><td>1271</td>
|
||||
<td class="red"> } catch(Doctrine_Connection_Exception $e) {
|
||||
</td></tr>
|
||||
<tr><td>1272</td>
|
||||
<td class="normal"> // we only want to silence table already exists errors
|
||||
</td></tr>
|
||||
<tr><td>1273</td>
|
||||
<td class="orange"> if ($e->getPortableCode() !== Doctrine::ERR_ALREADY_EXISTS) {
|
||||
</td></tr>
|
||||
<tr><td>1274</td>
|
||||
<td class="orange"> throw $e;
|
||||
</td></tr>
|
||||
<tr><td>1275</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>1276</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>1277</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>1278</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Expression.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: Expression.php 3212 2007-11-24 18:58:33Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 2702 $
|
||||
<td class="normal"> * @version $Revision: 3212 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -115,203 +115,330 @@
|
||||
<td class="normal"> protected $_expression;
|
||||
</td></tr>
|
||||
<tr><td>36</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> protected $_conn;
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="normal"> protected $_conn;
|
||||
<td class="normal"> protected $_tokenizer;
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal"> public function __construct($expr, $conn = null)
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * Create an expression
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="covered"> $this->setExpression($expr);
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> * @param string $expr The expression
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="covered"> if ($conn !== null) {
|
||||
<td class="normal"> * @param Doctrine_Connection $conn The connection (optional)
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="red"> $this->_conn = $conn;
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="red"> }
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="covered"> }
|
||||
<td class="normal"> public function __construct($expr, $conn = null)
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> public function getConnection()
|
||||
<td class="covered"> $this->_tokenizer = new Doctrine_Query_Tokenizer();
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> {
|
||||
<td class="covered"> $this->setExpression($expr);
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="covered"> if ( ! isset($this->_conn)) {
|
||||
<td class="covered"> if ($conn !== null) {
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="covered"> return Doctrine_Manager::connection();
|
||||
<td class="red"> $this->_conn = $conn;
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="orange"> }
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="red"> return $this->_conn;
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> public function setExpression($clause)
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="covered"> $this->_expression = $this->parseClause($clause);
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<tr><td>54</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="normal"> public function parseExpression($expr)
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<tr><td>56</td>
|
||||
<td class="normal"> * getConnection
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> * @return Doctrine_Connection The connection
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> public function getConnection()
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> if ( ! isset($this->_conn)) {
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="covered"> return Doctrine_Manager::connection();
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="covered"> $pos = strpos($expr, '(');
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="covered"> if ($pos === false) {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="covered"> return $expr;
|
||||
<td class="red"> return $this->_conn;
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="orange"> }
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> // get the name of the function
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="covered"> $name = substr($expr, 0, $pos);
|
||||
<td class="normal"> * setExpression
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="covered"> $argStr = substr($expr, ($pos + 1), -1);
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> * @param string $clause The expression to set
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal"> // parse args
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="covered"> foreach (Doctrine_Tokenizer::bracketExplode($argStr, ',') as $arg) {
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="covered"> $args[] = $this->parseClause($arg);
|
||||
<td class="normal"> public function setExpression($clause)
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="covered"> }
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $this->_expression = $this->parseClause($clause);
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="covered"> return call_user_func_array(array($this->getConnection()->expression, $name), $args);
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="normal"> public function parseClause($clause)
|
||||
<td class="normal"> * parseExpression
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="covered"> $e = Doctrine_Tokenizer::bracketExplode($clause, ' ');
|
||||
<td class="normal"> * @todo: What does this function do?
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="covered"> foreach ($e as $k => $expr) {
|
||||
<td class="normal"> * @param string $expr The expression to parse
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="covered"> $e[$k] = $this->parseExpression($expr);
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="covered"> }
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> public function parseExpression($expr)
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="covered"> return implode(' ', $e);
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> $pos = strpos($expr, '(');
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> if ($pos === false) {
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal"> public function getSql()
|
||||
<td class="covered"> return $expr;
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="normal"> {
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="covered"> return $this->_expression;
|
||||
<td class="normal"> // get the name of the function
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> $name = substr($expr, 0, $pos);
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $argStr = substr($expr, ($pos + 1), -1);
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="normal"> public function __toString()
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> // parse args
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="red"> return $this->getSql();
|
||||
<td class="covered"> foreach ($this->_tokenizer->bracketExplode($argStr, ',') as $arg) {
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> $args[] = $this->parseClause($arg);
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="covered"> return call_user_func_array(array($this->getConnection()->expression, $name), $args);
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="normal"> * parseClause
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="normal"> * @param string $clause The clause
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="normal"> * @return string The parse clause
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="normal"> public function parseClause($clause)
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="covered"> $e = $this->_tokenizer->bracketExplode($clause, ' ');
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="covered"> foreach ($e as $k => $expr) {
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="covered"> $e[$k] = $this->parseExpression($expr);
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="covered"> return implode(' ', $e);
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="normal"> * getSql
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="normal"> * @return string The expression
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="normal"> public function getSql()
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="covered"> return $this->_expression;
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="normal"> * __toString
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="normal"> public function __toString()
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="red"> return $this->getSql();
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -154,581 +154,585 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="red"> if ($this->string_quoting['escape_pattern']) {
|
||||
<td class="red"> if ( ! $this->string_quoting['escape_pattern']) {
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="red"> $tmp = $this->conn->string_quoting;
|
||||
<td class="red"> return $text;
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal">
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="red"> $text = str_replace($tmp['escape_pattern'],
|
||||
<td class="red"> $tmp = $this->conn->string_quoting;
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="red"> $tmp['escape_pattern'] .
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="red"> $tmp['escape_pattern'], $text);
|
||||
<td class="red"> $text = str_replace($tmp['escape_pattern'],
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal">
|
||||
<td class="red"> $tmp['escape_pattern'] .
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="red"> foreach ($this->wildcards as $wildcard) {
|
||||
<td class="red"> $tmp['escape_pattern'], $text);
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="red"> $text = str_replace($wildcard, $tmp['escape_pattern'] . $wildcard, $text);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="red"> }
|
||||
<td class="red"> foreach ($this->wildcards as $wildcard) {
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="red"> }
|
||||
<td class="red"> $text = str_replace($wildcard, $tmp['escape_pattern'] . $wildcard, $text);
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="red"> return $text;
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="orange"> }
|
||||
<td class="red"> return $text;
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="normal">
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> * convertBooleans
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> * some drivers need the boolean values to be converted into integers
|
||||
<td class="normal"> * convertBooleans
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> * when using DQL API
|
||||
<td class="normal"> * some drivers need the boolean values to be converted into integers
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * when using DQL API
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> * This method takes care of that conversion
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * This method takes care of that conversion
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> * @param array $item
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal"> * @return void
|
||||
<td class="normal"> * @param array $item
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal"> public function convertBooleans($item)
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> public function convertBooleans($item)
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="covered"> if (is_array($item)) {
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="covered"> foreach ($item as $k => $value) {
|
||||
<td class="covered"> if (is_array($item)) {
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="covered"> if (is_bool($value)) {
|
||||
<td class="covered"> foreach ($item as $k => $value) {
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="covered"> $item[$k] = (int) $value;
|
||||
<td class="covered"> if (is_bool($value)) {
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $item[$k] = (int) $value;
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="covered"> if (is_bool($item)) {
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="covered"> $item = (int) $item;
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="covered"> if (is_bool($item)) {
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="covered"> $item = (int) $item;
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="covered"> return $item;
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> return $item;
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal">
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="normal"> * Quote a string so it can be safely used as a table or column name
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * Quote a string so it can be safely used as a table or column name
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal"> * Delimiting style depends on which database driver is being used.
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * Delimiting style depends on which database driver is being used.
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="normal"> * NOTE: just because you CAN use delimited identifiers doesn't mean
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="normal"> * you SHOULD use them. In general, they end up causing way more
|
||||
<td class="normal"> * NOTE: just because you CAN use delimited identifiers doesn't mean
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="normal"> * problems than they solve.
|
||||
<td class="normal"> * you SHOULD use them. In general, they end up causing way more
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * problems than they solve.
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="normal"> * Portability is broken by using the following characters inside
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal"> * delimited identifiers:
|
||||
<td class="normal"> * Portability is broken by using the following characters inside
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="normal"> * + backtick (<kbd>`</kbd>) -- due to MySQL
|
||||
<td class="normal"> * delimited identifiers:
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="normal"> * + double quote (<kbd>"</kbd>) -- due to Oracle
|
||||
<td class="normal"> * + backtick (<kbd>`</kbd>) -- due to MySQL
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="normal"> * + brackets (<kbd>[</kbd> or <kbd>]</kbd>) -- due to Access
|
||||
<td class="normal"> * + double quote (<kbd>"</kbd>) -- due to Oracle
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * + brackets (<kbd>[</kbd> or <kbd>]</kbd>) -- due to Access
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="normal"> * Delimited identifiers are known to generally work correctly under
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="normal"> * the following drivers:
|
||||
<td class="normal"> * Delimited identifiers are known to generally work correctly under
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="normal"> * + mssql
|
||||
<td class="normal"> * the following drivers:
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal"> * + mysql
|
||||
<td class="normal"> * + mssql
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="normal"> * + mysqli
|
||||
<td class="normal"> * + mysql
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal"> * + oci8
|
||||
<td class="normal"> * + mysqli
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="normal"> * + pgsql
|
||||
<td class="normal"> * + oci8
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="normal"> * + sqlite
|
||||
<td class="normal"> * + pgsql
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * + sqlite
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="normal"> * InterBase doesn't seem to be able to use delimited identifiers
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="normal"> * via PHP 4. They work fine under PHP 5.
|
||||
<td class="normal"> * InterBase doesn't seem to be able to use delimited identifiers
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * via PHP 4. They work fine under PHP 5.
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="normal"> * @param string $str identifier name to be quoted
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="normal"> * @param bool $checkOption check the 'quote_identifier' option
|
||||
<td class="normal"> * @param string $str identifier name to be quoted
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * @param bool $checkOption check the 'quote_identifier' option
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="normal"> * @return string quoted identifier string
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @return string quoted identifier string
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="normal"> public function quoteIdentifier($str, $checkOption = true)
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> public function quoteIdentifier($str, $checkOption = true)
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="covered"> if ($checkOption && ! $this->conn->getAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER)) {
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="covered"> return $str;
|
||||
<td class="covered"> if ($checkOption && ! $this->conn->getAttribute(Doctrine::ATTR_QUOTE_IDENTIFIER)) {
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> return $str;
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="covered"> $tmp = $this->conn->identifier_quoting;
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="covered"> $str = str_replace($tmp['end'],
|
||||
<td class="covered"> $tmp = $this->conn->identifier_quoting;
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> $tmp['escape'] .
|
||||
<td class="covered"> $str = str_replace($tmp['end'],
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="covered"> $tmp['end'], $str);
|
||||
<td class="covered"> $tmp['escape'] .
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $tmp['end'], $str);
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="covered"> return $tmp['start'] . $str . $tmp['end'];
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> return $tmp['start'] . $str . $tmp['end'];
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="normal">
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="normal"> * quote
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="normal"> * quotes given input parameter
|
||||
<td class="normal"> * quote
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * quotes given input parameter
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="normal"> * @param mixed $input parameter to be quoted
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="normal"> * @param string $type
|
||||
<td class="normal"> * @param mixed $input parameter to be quoted
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="normal"> * @return mixed
|
||||
<td class="normal"> * @param string $type
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @return mixed
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="normal"> public function quote($input, $type = null)
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> public function quote($input, $type = null)
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="covered"> if ($type == null) {
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="covered"> $type = gettype($input);
|
||||
<td class="covered"> if ($type == null) {
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $type = gettype($input);
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="normal"> switch ($type) {
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="covered"> case 'integer':
|
||||
<td class="normal"> switch ($type) {
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="covered"> case 'enum':
|
||||
<td class="covered"> case 'integer':
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="covered"> case 'boolean':
|
||||
<td class="covered"> case 'enum':
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="covered"> case 'double':
|
||||
<td class="covered"> case 'boolean':
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="covered"> case 'float':
|
||||
<td class="covered"> case 'double':
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="covered"> case 'bool':
|
||||
<td class="covered"> case 'float':
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<td class="covered"> case 'decimal':
|
||||
<td class="covered"> case 'bool':
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<td class="covered"> case 'int':
|
||||
<td class="covered"> case 'decimal':
|
||||
</td></tr>
|
||||
<tr><td>156</td>
|
||||
<td class="covered"> return $input;
|
||||
<td class="covered"> case 'int':
|
||||
</td></tr>
|
||||
<tr><td>157</td>
|
||||
<td class="covered"> case 'array':
|
||||
<td class="covered"> return $input;
|
||||
</td></tr>
|
||||
<tr><td>158</td>
|
||||
<td class="covered"> case 'object':
|
||||
<td class="covered"> case 'array':
|
||||
</td></tr>
|
||||
<tr><td>159</td>
|
||||
<td class="covered"> $input = serialize($input);
|
||||
<td class="covered"> case 'object':
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<td class="covered"> case 'string':
|
||||
<td class="covered"> $input = serialize($input);
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="covered"> case 'char':
|
||||
<td class="covered"> case 'string':
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<td class="covered"> case 'varchar':
|
||||
<td class="covered"> case 'char':
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="covered"> case 'text':
|
||||
<td class="covered"> case 'varchar':
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<td class="covered"> case 'gzip':
|
||||
<td class="covered"> case 'text':
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="covered"> case 'blob':
|
||||
<td class="covered"> case 'gzip':
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="covered"> case 'clob':
|
||||
<td class="covered"> case 'blob':
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="covered"> $this->conn->connect();
|
||||
<td class="covered"> case 'clob':
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $this->conn->connect();
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="covered"> return $this->conn->getDbh()->quote($input);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>170</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> return $this->conn->getDbh()->quote($input);
|
||||
</td></tr>
|
||||
<tr><td>171</td>
|
||||
<td class="red"> }
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>172</td>
|
||||
<td class="normal">
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>173</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>174</td>
|
||||
<td class="normal"> * Removes any formatting in an sequence name using the 'seqname_format' option
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>175</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * Removes any formatting in an sequence name using the 'seqname_format' option
|
||||
</td></tr>
|
||||
<tr><td>176</td>
|
||||
<td class="normal"> * @param string $sqn string that containts name of a potential sequence
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>177</td>
|
||||
<td class="normal"> * @return string name of the sequence with possible formatting removed
|
||||
<td class="normal"> * @param string $sqn string that containts name of a potential sequence
|
||||
</td></tr>
|
||||
<tr><td>178</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @return string name of the sequence with possible formatting removed
|
||||
</td></tr>
|
||||
<tr><td>179</td>
|
||||
<td class="normal"> public function fixSequenceName($sqn)
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>180</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> public function fixSequenceName($sqn)
|
||||
</td></tr>
|
||||
<tr><td>181</td>
|
||||
<td class="red"> $seqPattern = '/^'.preg_replace('/%s/', '([a-z0-9_]+)', $this->conn->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT)).'$/i';
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>182</td>
|
||||
<td class="red"> $seqName = preg_replace($seqPattern, '\\1', $sqn);
|
||||
<td class="red"> $seqPattern = '/^'.preg_replace('/%s/', '([a-z0-9_]+)', $this->conn->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT)).'$/i';
|
||||
</td></tr>
|
||||
<tr><td>183</td>
|
||||
<td class="normal">
|
||||
<td class="red"> $seqName = preg_replace($seqPattern, '\\1', $sqn);
|
||||
</td></tr>
|
||||
<tr><td>184</td>
|
||||
<td class="red"> if ($seqName && ! strcasecmp($sqn, $this->getSequenceName($seqName))) {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>185</td>
|
||||
<td class="red"> return $seqName;
|
||||
<td class="red"> if ($seqName && ! strcasecmp($sqn, $this->getSequenceName($seqName))) {
|
||||
</td></tr>
|
||||
<tr><td>186</td>
|
||||
<td class="orange"> }
|
||||
<td class="red"> return $seqName;
|
||||
</td></tr>
|
||||
<tr><td>187</td>
|
||||
<td class="red"> return $sqn;
|
||||
</td></tr>
|
||||
<tr><td>188</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>189</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>190</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>191</td>
|
||||
<td class="normal"> * Removes any formatting in an index name using the 'idxname_format' option
|
||||
</td></tr>
|
||||
<tr><td>192</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>193</td>
|
||||
<td class="normal"> * @param string $idx string that containts name of anl index
|
||||
</td></tr>
|
||||
<tr><td>194</td>
|
||||
<td class="normal"> * @return string name of the index with possible formatting removed
|
||||
</td></tr>
|
||||
<tr><td>195</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>196</td>
|
||||
<td class="normal"> public function fixIndexName($idx)
|
||||
</td></tr>
|
||||
<tr><td>197</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>198</td>
|
||||
<td class="red"> $indexPattern = '/^'.preg_replace('/%s/', '([a-z0-9_]+)', $this->conn->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT)).'$/i';
|
||||
</td></tr>
|
||||
<tr><td>199</td>
|
||||
<td class="red"> $indexName = preg_replace($indexPattern, '\\1', $idx);
|
||||
</td></tr>
|
||||
<tr><td>200</td>
|
||||
<td class="red"> if ($indexName && ! strcasecmp($idx, $this->getIndexName($indexName))) {
|
||||
</td></tr>
|
||||
<tr><td>201</td>
|
||||
<td class="red"> return $indexName;
|
||||
</td></tr>
|
||||
<tr><td>202</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>188</td>
|
||||
<td class="red"> return $sqn;
|
||||
</td></tr>
|
||||
<tr><td>189</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>190</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>191</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>192</td>
|
||||
<td class="normal"> * Removes any formatting in an index name using the 'idxname_format' option
|
||||
</td></tr>
|
||||
<tr><td>193</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>194</td>
|
||||
<td class="normal"> * @param string $idx string that containts name of anl index
|
||||
</td></tr>
|
||||
<tr><td>195</td>
|
||||
<td class="normal"> * @return string name of the index with possible formatting removed
|
||||
</td></tr>
|
||||
<tr><td>196</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>197</td>
|
||||
<td class="normal"> public function fixIndexName($idx)
|
||||
</td></tr>
|
||||
<tr><td>198</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>199</td>
|
||||
<td class="red"> $indexPattern = '/^'.preg_replace('/%s/', '([a-z0-9_]+)', $this->conn->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT)).'$/i';
|
||||
</td></tr>
|
||||
<tr><td>200</td>
|
||||
<td class="red"> $indexName = preg_replace($indexPattern, '\\1', $idx);
|
||||
</td></tr>
|
||||
<tr><td>201</td>
|
||||
<td class="red"> if ($indexName && ! strcasecmp($idx, $this->getIndexName($indexName))) {
|
||||
</td></tr>
|
||||
<tr><td>202</td>
|
||||
<td class="red"> return $indexName;
|
||||
</td></tr>
|
||||
<tr><td>203</td>
|
||||
<td class="red"> return $idx;
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>204</td>
|
||||
<td class="orange"> }
|
||||
<td class="red"> return $idx;
|
||||
</td></tr>
|
||||
<tr><td>205</td>
|
||||
<td class="normal">
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>206</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>207</td>
|
||||
<td class="normal"> * adds sequence name formatting to a sequence name
|
||||
</td></tr>
|
||||
<tr><td>208</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>209</td>
|
||||
<td class="normal"> * @param string name of the sequence
|
||||
</td></tr>
|
||||
<tr><td>210</td>
|
||||
<td class="normal"> * @return string formatted sequence name
|
||||
</td></tr>
|
||||
<tr><td>211</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>212</td>
|
||||
<td class="normal"> public function getSequenceName($sqn)
|
||||
</td></tr>
|
||||
<tr><td>213</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>214</td>
|
||||
<td class="covered"> return sprintf($this->conn->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT),
|
||||
</td></tr>
|
||||
<tr><td>215</td>
|
||||
<td class="covered"> preg_replace('/[^a-z0-9_\$.]/i', '_', $sqn));
|
||||
</td></tr>
|
||||
<tr><td>216</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>217</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>218</td>
|
||||
<tr><td>207</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>208</td>
|
||||
<td class="normal"> * adds sequence name formatting to a sequence name
|
||||
</td></tr>
|
||||
<tr><td>209</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>210</td>
|
||||
<td class="normal"> * @param string name of the sequence
|
||||
</td></tr>
|
||||
<tr><td>211</td>
|
||||
<td class="normal"> * @return string formatted sequence name
|
||||
</td></tr>
|
||||
<tr><td>212</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>213</td>
|
||||
<td class="normal"> public function getSequenceName($sqn)
|
||||
</td></tr>
|
||||
<tr><td>214</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>215</td>
|
||||
<td class="covered"> return sprintf($this->conn->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT),
|
||||
</td></tr>
|
||||
<tr><td>216</td>
|
||||
<td class="covered"> preg_replace('/[^a-z0-9_\$.]/i', '_', $sqn));
|
||||
</td></tr>
|
||||
<tr><td>217</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>218</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>219</td>
|
||||
<td class="normal"> * adds index name formatting to a index name
|
||||
</td></tr>
|
||||
<tr><td>220</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>221</td>
|
||||
<td class="normal"> * @param string name of the index
|
||||
</td></tr>
|
||||
<tr><td>222</td>
|
||||
<td class="normal"> * @return string formatted index name
|
||||
</td></tr>
|
||||
<tr><td>223</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>224</td>
|
||||
<td class="normal"> public function getIndexName($idx)
|
||||
</td></tr>
|
||||
<tr><td>225</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>226</td>
|
||||
<td class="covered"> return sprintf($this->conn->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT),
|
||||
</td></tr>
|
||||
<tr><td>227</td>
|
||||
<td class="covered"> preg_replace('/[^a-z0-9_\$]/i', '_', $idx));
|
||||
</td></tr>
|
||||
<tr><td>228</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>229</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>230</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>231</td>
|
||||
<td class="normal"> * adds table name formatting to a table name
|
||||
<tr><td>220</td>
|
||||
<td class="normal"> * adds index name formatting to a index name
|
||||
</td></tr>
|
||||
<tr><td>232</td>
|
||||
<tr><td>221</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>233</td>
|
||||
<td class="normal"> * @param string name of the table
|
||||
<tr><td>222</td>
|
||||
<td class="normal"> * @param string name of the index
|
||||
</td></tr>
|
||||
<tr><td>234</td>
|
||||
<td class="normal"> * @return string formatted table name
|
||||
<tr><td>223</td>
|
||||
<td class="normal"> * @return string formatted index name
|
||||
</td></tr>
|
||||
<tr><td>235</td>
|
||||
<tr><td>224</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>236</td>
|
||||
<td class="normal"> public function getTableName($table)
|
||||
<tr><td>225</td>
|
||||
<td class="normal"> public function getIndexName($idx)
|
||||
</td></tr>
|
||||
<tr><td>237</td>
|
||||
<tr><td>226</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>238</td>
|
||||
<td class="covered"> return sprintf($this->conn->getAttribute(Doctrine::ATTR_TBLNAME_FORMAT),
|
||||
<tr><td>227</td>
|
||||
<td class="covered"> return sprintf($this->conn->getAttribute(Doctrine::ATTR_IDXNAME_FORMAT),
|
||||
</td></tr>
|
||||
<tr><td>239</td>
|
||||
<td class="covered"> preg_replace('/[^a-z0-9_\$]/i', '_', $table));
|
||||
<tr><td>228</td>
|
||||
<td class="covered"> preg_replace('/[^a-z0-9_\$]/i', '_', $idx));
|
||||
</td></tr>
|
||||
<tr><td>240</td>
|
||||
<tr><td>229</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>230</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>231</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>232</td>
|
||||
<td class="normal"> * adds table name formatting to a table name
|
||||
</td></tr>
|
||||
<tr><td>233</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>234</td>
|
||||
<td class="normal"> * @param string name of the table
|
||||
</td></tr>
|
||||
<tr><td>235</td>
|
||||
<td class="normal"> * @return string formatted table name
|
||||
</td></tr>
|
||||
<tr><td>236</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>237</td>
|
||||
<td class="normal"> public function getTableName($table)
|
||||
</td></tr>
|
||||
<tr><td>238</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>239</td>
|
||||
<td class="covered"> return sprintf($this->conn->getAttribute(Doctrine::ATTR_TBLNAME_FORMAT),
|
||||
</td></tr>
|
||||
<tr><td>240</td>
|
||||
<td class="covered"> preg_replace('/[^a-z0-9_\$]/i', '_', $table));
|
||||
</td></tr>
|
||||
<tr><td>241</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>242</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Hook.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: Hook.php 3189 2007-11-18 20:37:44Z meus $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 2963 $
|
||||
<td class="normal"> * @version $Revision: 3189 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -640,47 +640,63 @@
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>211</td>
|
||||
<td class="normal"> * @param integer $limit
|
||||
<td class="normal"> * set the hook limit
|
||||
</td></tr>
|
||||
<tr><td>212</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>213</td>
|
||||
<td class="normal"> public function hookLimit($limit)
|
||||
<td class="normal"> * @param integer $limit
|
||||
</td></tr>
|
||||
<tr><td>214</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>215</td>
|
||||
<td class="red"> $this->query->limit((int) $limit);
|
||||
</td></tr>
|
||||
<tr><td>216</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>217</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>218</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>219</td>
|
||||
<td class="normal"> * @param integer $offset
|
||||
</td></tr>
|
||||
<tr><td>220</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>221</td>
|
||||
<td class="normal"> public function hookOffset($offset)
|
||||
<tr><td>216</td>
|
||||
<td class="normal"> public function hookLimit($limit)
|
||||
</td></tr>
|
||||
<tr><td>222</td>
|
||||
<tr><td>217</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>223</td>
|
||||
<td class="red"> $this->query->offset((int) $offset);
|
||||
<tr><td>218</td>
|
||||
<td class="red"> $this->query->limit((int) $limit);
|
||||
</td></tr>
|
||||
<tr><td>224</td>
|
||||
<tr><td>219</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>220</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>221</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>222</td>
|
||||
<td class="normal"> * set the hook offset
|
||||
</td></tr>
|
||||
<tr><td>223</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>224</td>
|
||||
<td class="normal"> * @param integer $offset
|
||||
</td></tr>
|
||||
<tr><td>225</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>226</td>
|
||||
<td class="normal"> public function hookOffset($offset)
|
||||
</td></tr>
|
||||
<tr><td>227</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>228</td>
|
||||
<td class="red"> $this->query->offset((int) $offset);
|
||||
</td></tr>
|
||||
<tr><td>229</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>230</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Complex.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: Complex.php 3212 2007-11-24 18:58:33Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 2963 $
|
||||
<td class="normal"> * @version $Revision: 3212 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -112,191 +112,221 @@
|
||||
<td class="normal">{
|
||||
</td></tr>
|
||||
<tr><td>35</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal"> protected $_tokenizer;
|
||||
</td></tr>
|
||||
<tr><td>36</td>
|
||||
<td class="normal"> * parse
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="normal"> * Parses given field and field value to DQL condition
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal"> * and parameters. This method should always return
|
||||
<td class="normal"> * Constructor.
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal"> * prepared statement conditions (conditions that use
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> * placeholders instead of literal values).
|
||||
<td class="normal"> public function __construct()
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal"> * @param string $alias component alias
|
||||
<td class="covered"> $this->_tokenizer = new Doctrine_Query_Tokenizer();
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> * @param string $field the field name
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> * @param mixed $value the value of the field
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> public function parse($alias, $field, $value)
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="covered"> $this->condition = $this->parseClause($alias, $field, $value);
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> * parse
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> * Parses given field and field value to DQL condition
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> * and parameters. This method should always return
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> * prepared statement conditions (conditions that use
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> * placeholders instead of literal values).
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal"> * @param string $alias component alias
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal"> * parseClause
|
||||
<td class="normal"> * @param string $field the field name
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * @param mixed $value the value of the field
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> * @param string $alias component alias
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal"> * @param string $field the field name
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> * @param mixed $value the value of the field
|
||||
<td class="normal"> public function parse($alias, $field, $value)
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> public function parseClause($alias, $field, $value)
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="covered"> $this->condition = $this->parseClause($alias, $field, $value);
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> $parts = Doctrine_Tokenizer::quoteExplode($value, ' AND ');
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="covered"> if (count($parts) > 1) {
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="red"> $ret = array();
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="red"> foreach ($parts as $part) {
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="red"> $ret[] = $this->parseSingle($alias, $field, $part);
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="red"> $r = implode(' AND ', $ret);
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="covered"> $parts = Doctrine_Tokenizer::quoteExplode($value, ' OR ');
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="covered"> if (count($parts) > 1) {
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="covered"> $ret = array();
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="covered"> foreach ($parts as $part) {
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="covered"> $ret[] = $this->parseClause($alias, $field, $part);
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="covered"> $r = implode(' OR ', $ret);
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="covered"> $ret = $this->parseSingle($alias, $field, $parts[0]);
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="covered"> return $ret;
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="covered"> return '(' . $r . ')';
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> * parseSingle
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> * parseClause
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> * @param string $alias component alias
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> * @param string $field the field name
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<tr><td>67</td>
|
||||
<td class="normal"> * @param mixed $value the value of the field
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> public function parseClause($alias, $field, $value)
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="covered"> $parts = $this->_tokenizer->quoteExplode($value, ' AND ');
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="covered"> if (count($parts) > 1) {
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="red"> $ret = array();
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="red"> foreach ($parts as $part) {
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="red"> $ret[] = $this->parseSingle($alias, $field, $part);
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="red"> $r = implode(' AND ', $ret);
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="covered"> $parts = $this->_tokenizer->quoteExplode($value, ' OR ');
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="covered"> if (count($parts) > 1) {
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="covered"> $ret = array();
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="covered"> foreach ($parts as $part) {
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="covered"> $ret[] = $this->parseClause($alias, $field, $part);
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="covered"> $r = implode(' OR ', $ret);
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="covered"> $ret = $this->parseSingle($alias, $field, $parts[0]);
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="covered"> return $ret;
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="covered"> return '(' . $r . ')';
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="normal"> abstract public function parseSingle($alias, $field, $value);
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal"> * parseSingle
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="normal"> * @param string $alias component alias
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="normal"> * @param string $field the field name
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="normal"> * @param mixed $value the value of the field
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="normal"> abstract public function parseSingle($alias, $field, $value);
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="covered">}</td></tr>
|
||||
</table></body></html>
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: WordLike.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: WordLike.php 3212 2007-11-24 18:58:33Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 2702 $
|
||||
<td class="normal"> * @version $Revision: 3212 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -157,7 +157,7 @@
|
||||
<td class="covered"> if (strpos($value, "'") !== false) {
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="covered"> $value = Doctrine_Tokenizer::bracketTrim($value, "'", "'");
|
||||
<td class="covered"> $value = $this->_tokenizer->bracketTrim($value, "'", "'");
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal">
|
||||
@ -166,7 +166,7 @@
|
||||
<td class="covered"> $a[] = $alias . '.' . $field . ' LIKE ?';
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="covered"> $this->params[] = $value . '%';
|
||||
<td class="covered"> $this->params[] = '%' . $value . '%';
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal">
|
||||
@ -190,7 +190,7 @@
|
||||
<td class="covered"> $a[] = $alias . '.' . $field . ' LIKE ?';
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="covered"> $this->params[] = $v . '%';
|
||||
<td class="covered"> $this->params[] = '%' . $v . '%';
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> }
|
||||
@ -205,5 +205,6 @@
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
1002
tests/coverage/Doctrine_Hydrator.html
Normal file
1002
tests/coverage/Doctrine_Hydrator.html
Normal file
File diff suppressed because it is too large
Load Diff
357
tests/coverage/Doctrine_Hydrator_Abstract.html
Normal file
357
tests/coverage/Doctrine_Hydrator_Abstract.html
Normal file
@ -0,0 +1,357 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Coverage for Doctrine_Hydrator_Abstract</title>
|
||||
<style type="text/css">
|
||||
.covered{ background: green;}
|
||||
.normal{ background: white;}
|
||||
.red{ background: red;}
|
||||
.orange{ background: #f90;}
|
||||
</style>
|
||||
</head>
|
||||
<body><h1>Coverage for Doctrine_Hydrator_Abstract</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>
|
||||
<td class="normal"> * $Id: Hydrate.php 3192 2007-11-19 17:55:23Z romanb $
|
||||
</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>
|
||||
<td class="normal"> * <http://www.phpdoctrine.com>.
|
||||
</td></tr>
|
||||
<tr><td>20</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>21</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>22</td>
|
||||
<td class="normal">/**
|
||||
</td></tr>
|
||||
<tr><td>23</td>
|
||||
<td class="normal"> * Doctrine_Hydrator_Abstract
|
||||
</td></tr>
|
||||
<tr><td>24</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>25</td>
|
||||
<td class="normal"> * @package Doctrine
|
||||
</td></tr>
|
||||
<tr><td>26</td>
|
||||
<td class="normal"> * @subpackage Hydrate
|
||||
</td></tr>
|
||||
<tr><td>27</td>
|
||||
<td class="normal"> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
</td></tr>
|
||||
<tr><td>28</td>
|
||||
<td class="normal"> * @link www.phpdoctrine.com
|
||||
</td></tr>
|
||||
<tr><td>29</td>
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 3192 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
</td></tr>
|
||||
<tr><td>32</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>33</td>
|
||||
<td class="normal">abstract class Doctrine_Hydrator_Abstract extends Doctrine_Locator_Injectable
|
||||
</td></tr>
|
||||
<tr><td>34</td>
|
||||
<td class="normal">{
|
||||
</td></tr>
|
||||
<tr><td>35</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>36</td>
|
||||
<td class="normal"> * @var array $_aliasMap two dimensional array containing the map for query aliases
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="normal"> * Main keys are component aliases
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal"> * table table object associated with given alias
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal"> * relation the relation object owned by the parent
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> * parent the alias of the parent
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> * agg the aggregates of this component
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> * map the name of the column / aggregate value this
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> * component is mapped to a collection
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> protected $_queryComponents = array();
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal"> * The current hydration mode.
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> protected $_hydrationMode = Doctrine::HYDRATE_RECORD;
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> * constructor
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> * @param Doctrine_Connection|null $connection
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> public function __construct() {}
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> * Sets the fetchmode.
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="normal"> * @param integer $fetchmode One of the Doctrine::HYDRATE_* constants.
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> public function setHydrationMode($hydrationMode)
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="covered"> $this->_hydrationMode = $hydrationMode;
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="normal"> * setAliasMap
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="normal"> * sets the whole component alias map
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="normal"> * @param array $map alias map
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="normal"> * @return Doctrine_Hydrate this object
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="normal"> public function setQueryComponents(array $queryComponents)
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="covered"> $this->_queryComponents = $queryComponents;
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="normal"> * getAliasMap
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal"> * returns the component alias map
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="normal"> * @return array component alias map
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal"> public function getQueryComponents()
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="red"> return $this->_queryComponents;
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="normal"> * parseData
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal"> * parses the data returned by statement object
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="normal"> * This is method defines the core of Doctrine object population algorithm
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="normal"> * hence this method strives to be as fast as possible
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="normal"> * The key idea is the loop over the rowset only once doing all the needed operations
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="normal"> * within this massive loop.
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal"> * @todo: Can we refactor this function so that it is not so long and
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="normal"> * nested?
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="normal"> * @param mixed $stmt
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="normal"> * @return array
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="normal"> abstract public function hydrateResultSet($stmt, $tableAliases, $hydrationMode = null);
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
231
tests/coverage/Doctrine_Hydrator_ArrayDriver.html
Normal file
231
tests/coverage/Doctrine_Hydrator_ArrayDriver.html
Normal file
@ -0,0 +1,231 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Coverage for Doctrine_Hydrator_ArrayDriver</title>
|
||||
<style type="text/css">
|
||||
.covered{ background: green;}
|
||||
.normal{ background: white;}
|
||||
.red{ background: red;}
|
||||
.orange{ background: #f90;}
|
||||
</style>
|
||||
</head>
|
||||
<body><h1>Coverage for Doctrine_Hydrator_ArrayDriver</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>
|
||||
<td class="normal"> * $Id$
|
||||
</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>
|
||||
<td class="normal"> * <http://www.phpdoctrine.com>.
|
||||
</td></tr>
|
||||
<tr><td>20</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>21</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>22</td>
|
||||
<td class="normal">/**
|
||||
</td></tr>
|
||||
<tr><td>23</td>
|
||||
<td class="normal"> * Doctrine_Hydrate_Array
|
||||
</td></tr>
|
||||
<tr><td>24</td>
|
||||
<td class="normal"> * defines an array fetching strategy for Doctrine_Hydrate
|
||||
</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 Hydrate
|
||||
</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>
|
||||
<td class="normal"> * @link www.phpdoctrine.com
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @version $Revision$
|
||||
</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="normal">class Doctrine_Hydrator_ArrayDriver
|
||||
</td></tr>
|
||||
<tr><td>35</td>
|
||||
<td class="covered">{
|
||||
</td></tr>
|
||||
<tr><td>36</td>
|
||||
<td class="normal"> public function getElementCollection($component)
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="covered"> return array();
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> public function getElement(array $data, $component)
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="covered"> return $data;
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> public function isIdentifiable(array $data, Doctrine_Table $table)
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="red"> return ( ! empty($data));
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> public function registerCollection($coll)
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="normal"> public function initRelated(array &$data, $name)
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="covered"> if ( ! isset($data[$name])) {
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="covered"> $data[$name] = array();
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="covered"> return true;
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> public function getNullPointer()
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="covered"> return null;
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> public function getLastKey(&$data)
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="covered"> end($data);
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="covered"> return key($data);
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> public function flush()
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
414
tests/coverage/Doctrine_Hydrator_RecordDriver.html
Normal file
414
tests/coverage/Doctrine_Hydrator_RecordDriver.html
Normal file
@ -0,0 +1,414 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Coverage for Doctrine_Hydrator_RecordDriver</title>
|
||||
<style type="text/css">
|
||||
.covered{ background: green;}
|
||||
.normal{ background: white;}
|
||||
.red{ background: red;}
|
||||
.orange{ background: #f90;}
|
||||
</style>
|
||||
</head>
|
||||
<body><h1>Coverage for Doctrine_Hydrator_RecordDriver</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>
|
||||
<td class="normal"> * $Id$
|
||||
</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>
|
||||
<td class="normal"> * <http://www.phpdoctrine.com>.
|
||||
</td></tr>
|
||||
<tr><td>20</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>21</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>22</td>
|
||||
<td class="normal">/**
|
||||
</td></tr>
|
||||
<tr><td>23</td>
|
||||
<td class="normal"> * Doctrine_Hydrate_Record
|
||||
</td></tr>
|
||||
<tr><td>24</td>
|
||||
<td class="normal"> * defines a record fetching strategy for Doctrine_Hydrate
|
||||
</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 Hydrate
|
||||
</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>
|
||||
<td class="normal"> * @link www.phpdoctrine.com
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @version $Revision$
|
||||
</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_Hydrator_RecordDriver extends Doctrine_Locator_Injectable
|
||||
</td></tr>
|
||||
<tr><td>35</td>
|
||||
<td class="normal">{
|
||||
</td></tr>
|
||||
<tr><td>36</td>
|
||||
<td class="normal"> protected $_collections = array();
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal"> protected $_records = array();
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> protected $_tables = array();
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal"> public function getElementCollection($component)
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="covered"> $coll = new Doctrine_Collection($component);
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="covered"> $this->_collections[] = $coll;
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="covered"> return $coll;
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> public function getLastKey($coll)
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="covered"> $coll->end();
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="covered"> return $coll->key();
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> public function initRelated($record, $name)
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="covered"> return true;
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> /*
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal"> if ( ! is_array($record)) {
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="normal"> $record[$name];
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> return true;
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> return false;
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> public function registerCollection(Doctrine_Collection $coll)
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="covered"> $this->_collections[] = $coll;
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="normal"> * isIdentifiable
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="normal"> * returns whether or not a given data row is identifiable (it contains
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="normal"> * all primary key fields specified in the second argument)
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="normal"> * @param array $row
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="normal"> * @param Doctrine_Table $table
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="normal"> * @return boolean
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="normal"> public function isIdentifiable(array $row, Doctrine_Table $table)
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="red"> $primaryKeys = $table->getIdentifierColumnNames();
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="red"> if (is_array($primaryKeys)) {
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="red"> foreach ($primaryKeys as $id) {
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="red"> if ( ! isset($row[$id])) {
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="red"> return false;
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="red"> if ( ! isset($row[$primaryKeys])) {
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="red"> return false;
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="red"> return true;
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="normal"> public function getNullPointer()
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="covered"> return self::$_null;
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="normal"> public function getElement(array $data, $component)
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="covered"> if ( ! isset($this->_tables[$component])) {
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="covered"> $this->_tables[$component] = Doctrine_Manager::getInstance()->getTable($component);
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="covered"> $this->_tables[$component]->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, false);
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="covered"> $this->_tables[$component]->setData($data);
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="covered"> $record = $this->_tables[$component]->getRecord();
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="covered"> if ( ! isset($this->_records[$record->getOid()]) ) {
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="covered"> $record->clearRelated();
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="covered"> $this->_records[$record->getOid()] = $record;
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="covered"> return $record;
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="normal"> public function flush()
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="normal"> // take snapshots from all initialized collections
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="covered"> foreach ($this->_collections as $key => $coll) {
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> $coll->takeSnapshot();
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="covered"> foreach ($this->_tables as $table) {
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="covered"> $table->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, true);
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -130,266 +130,219 @@
|
||||
<td class="normal"> 'pluginTable' => false,
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal"> );
|
||||
<td class="normal"> 'children' => array(),
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> );
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> * __construct
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> * @param string $options
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> public function __construct($options)
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="covered"> $this->_options = array_merge($this->_options, $options);
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> * buildDefinition
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> * __construct
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> * @param object $Doctrine_Table
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> * @param string $options
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> public function buildDefinition(Doctrine_Table $table)
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> public function __construct($options)
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<tr><td>51</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="covered"> $this->_options = array_merge($this->_options, $options);
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal"> * buildDefinition
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> * @param object $Doctrine_Table
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal"> public function buildDefinition()
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> if (empty($this->_options['fields'])) {
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="red"> throw new Doctrine_I18n_Exception('Fields not set.');
|
||||
<td class="covered"> if (empty($this->_options['fields'])) {
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="orange"> }
|
||||
<td class="red"> throw new Doctrine_I18n_Exception('Fields not set.');
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal">
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="covered"> $this->_options['className'] = str_replace('%CLASS%',
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="covered"> $this->_options['table']->getComponentName(),
|
||||
<td class="covered"> $name = $this->_options['table']->getComponentName();
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="covered"> $this->_options['className']);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="covered"> $name = $table->getComponentName();
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="covered"> if (class_exists($this->_options['className'])) {
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="red"> return false;
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="covered"> $columns = array();
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<tr><td>70</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="covered"> $id = $table->getIdentifier();
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<tr><td>71</td>
|
||||
<td class="covered"> $options = array('className' => $this->_options['className']);
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<tr><td>72</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="covered"> $fk = array();
|
||||
<tr><td>73</td>
|
||||
<td class="covered"> $fk = $this->buildForeignKeys($this->_options['table']);
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="covered"> foreach ((array) $id as $column) {
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="covered"> $def = $table->getDefinitionOf($column);
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<tr><td>74</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="covered"> unset($def['autoincrement']);
|
||||
<tr><td>75</td>
|
||||
<td class="covered"> $cols = $this->_options['table']->getColumns();
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="covered"> unset($def['sequence']);
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="covered"> unset($def['unique']);
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<tr><td>76</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="covered"> $fk[$column] = $def;
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="covered"> $cols = $table->getColumns();
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<tr><td>77</td>
|
||||
<td class="covered"> foreach ($cols as $column => $definition) {
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<tr><td>78</td>
|
||||
<td class="covered"> if (in_array($column, $this->_options['fields'])) {
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<tr><td>79</td>
|
||||
<td class="covered"> $columns[$column] = $definition;
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="covered"> $table->removeColumn($column);
|
||||
<tr><td>80</td>
|
||||
<td class="covered"> $this->_options['table']->removeColumn($column);
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<tr><td>81</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<tr><td>82</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="normal">
|
||||
<tr><td>83</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<tr><td>84</td>
|
||||
<td class="covered"> $columns['lang'] = array('type' => 'string',
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<tr><td>85</td>
|
||||
<td class="covered"> 'length' => 2,
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<tr><td>86</td>
|
||||
<td class="covered"> 'fixed' => true,
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<tr><td>87</td>
|
||||
<td class="covered"> 'primary' => true);
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<tr><td>88</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<tr><td>89</td>
|
||||
<td class="covered"> $local = (count($fk) > 1) ? array_keys($fk) : key($fk);
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<tr><td>90</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<tr><td>91</td>
|
||||
<td class="covered"> $relations = array($name => array('local' => $local,
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="covered"> 'foreign' => $id,
|
||||
<tr><td>92</td>
|
||||
<td class="covered"> 'foreign' => $this->_options['table']->getIdentifier(),
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<tr><td>93</td>
|
||||
<td class="covered"> 'onDelete' => 'CASCADE',
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<tr><td>94</td>
|
||||
<td class="covered"> 'onUpdate' => 'CASCADE'));
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<tr><td>95</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<tr><td>96</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<tr><td>97</td>
|
||||
<td class="covered"> $columns += $fk;
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<tr><td>98</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<tr><td>99</td>
|
||||
<td class="covered"> $options = array('className' => $this->_options['className'],
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<tr><td>100</td>
|
||||
<td class="covered"> 'queryParts' => array('indexBy' => 'lang'));
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<tr><td>101</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<tr><td>102</td>
|
||||
<td class="covered"> $this->generateClass($options, $columns, $relations);
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<tr><td>103</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="covered"> $this->_options['pluginTable'] = $table->getConnection()->getTable($this->_options['className']);
|
||||
<tr><td>104</td>
|
||||
<td class="covered"> $this->_options['pluginTable'] = $this->_options['table']->getConnection()->getTable($this->_options['className']);
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<tr><td>105</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<tr><td>106</td>
|
||||
<td class="covered"> $this->_options['pluginTable']->bindQueryPart('indexBy', 'lang');
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<tr><td>107</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<tr><td>108</td>
|
||||
<td class="covered"> $this->generateChildDefinitions();
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="covered"> return true;
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<tr><td>111</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Oracle.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: Oracle.php 3159 2007-11-15 05:16:31Z Jonathan.Wage $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -88,7 +88,7 @@
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
</td></tr>
|
||||
<tr><td>27</td>
|
||||
<td class="normal"> * @version $Revision: 2963 $
|
||||
<td class="normal"> * @version $Revision: 3159 $
|
||||
</td></tr>
|
||||
<tr><td>28</td>
|
||||
<td class="normal"> * @link www.phpdoctrine.com
|
||||
@ -394,326 +394,336 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="covered"> foreach($result as $val) {
|
||||
<td class="covered"> $descr = array();
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="red"> $val = array_change_key_case($val, CASE_LOWER);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="red"> $decl = $this->conn->dataDict->getPortableDeclaration($val);
|
||||
<td class="covered"> foreach($result as $val) {
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="normal">
|
||||
<td class="red"> $val = array_change_key_case($val, CASE_LOWER);
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="normal">
|
||||
<td class="red"> $decl = $this->conn->dataDict->getPortableDeclaration($val);
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="red"> $descr[$val['column_name']] = array(
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="red"> 'name' => $val['column_name'],
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="red"> 'notnull' => (bool) ($val['nullable'] === 'N'),
|
||||
<td class="red"> $descr[$val['column_name']] = array(
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="red"> 'ntype' => $val['data_type'],
|
||||
<td class="red"> 'name' => $val['column_name'],
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="red"> 'type' => $decl['type'][0],
|
||||
<td class="red"> 'notnull' => (bool) ($val['nullable'] === 'N'),
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="red"> 'alltypes' => $decl['type'],
|
||||
<td class="red"> 'ntype' => $val['data_type'],
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="red"> 'fixed' => $decl['fixed'],
|
||||
<td class="red"> 'type' => $decl['type'][0],
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="red"> 'unsigned' => $decl['unsigned'],
|
||||
<td class="red"> 'alltypes' => $decl['type'],
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="red"> 'default' => $val['data_default'],
|
||||
<td class="red"> 'fixed' => $decl['fixed'],
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="red"> 'length' => $val['data_length'],
|
||||
<td class="red"> 'unsigned' => $decl['unsigned'],
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="red"> 'precision' => $val['data_precision'],
|
||||
<td class="red"> 'default' => $val['data_default'],
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="red"> 'scale' => $val['scale'],
|
||||
<td class="red"> 'length' => $val['data_length'],
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="normal"> );
|
||||
<td class="red"> 'precision' => $val['data_precision'],
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="red"> }
|
||||
<td class="red"> 'scale' => $val['scale'],
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="covered"> return $result;
|
||||
<td class="normal"> );
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="orange"> }
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="normal"> /**
|
||||
<td class="covered"> return $descr;
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="normal"> * lists table constraints
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<td class="normal"> * @param string $table database table name
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<td class="normal"> * @return array
|
||||
<td class="normal"> * lists table constraints
|
||||
</td></tr>
|
||||
<tr><td>156</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>157</td>
|
||||
<td class="normal"> public function listTableIndexes($table)
|
||||
<td class="normal"> * @param string $table database table name
|
||||
</td></tr>
|
||||
<tr><td>158</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * @return array
|
||||
</td></tr>
|
||||
<tr><td>159</td>
|
||||
<td class="covered"> $table = $this->conn->quote($table, 'text');
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<td class="normal"> $query = 'SELECT index_name name FROM user_indexes'
|
||||
<td class="normal"> public function listTableIndexes($table)
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="covered"> . ' WHERE table_name = ' . $table . ' OR table_name = ' . strtoupper($table)
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<td class="covered"> . ' AND generated = ' . $this->conn->quote('N', 'text');
|
||||
<td class="covered"> $table = $this->conn->quote($table, 'text');
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> $query = 'SELECT index_name name FROM user_indexes'
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<td class="covered"> $indexes = $this->conn->fetchColumn($query);
|
||||
<td class="covered"> . ' WHERE table_name = ' . $table . ' OR table_name = ' . strtoupper($table)
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> . ' AND generated = ' . $this->conn->quote('N', 'text');
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="covered"> return array_map(array($this->conn->formatter, 'fixIndexName'), $indexes);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> $indexes = $this->conn->fetchColumn($query);
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="normal"> /**
|
||||
<td class="covered"> return array_map(array($this->conn->formatter, 'fixIndexName'), $indexes);
|
||||
</td></tr>
|
||||
<tr><td>170</td>
|
||||
<td class="normal"> * lists tables
|
||||
</td></tr>
|
||||
<tr><td>171</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>172</td>
|
||||
<td class="normal"> * @param string|null $database
|
||||
</td></tr>
|
||||
<tr><td>173</td>
|
||||
<td class="normal"> * @return array
|
||||
</td></tr>
|
||||
<tr><td>174</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>175</td>
|
||||
<td class="normal"> public function listTables($database = null)
|
||||
</td></tr>
|
||||
<tr><td>176</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>177</td>
|
||||
<td class="covered"> $query = 'SELECT table_name FROM sys.user_tables';
|
||||
</td></tr>
|
||||
<tr><td>178</td>
|
||||
<td class="covered"> return $this->conn->fetchColumn($query);
|
||||
</td></tr>
|
||||
<tr><td>179</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>180</td>
|
||||
<tr><td>171</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>172</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>173</td>
|
||||
<td class="normal"> * lists tables
|
||||
</td></tr>
|
||||
<tr><td>174</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>175</td>
|
||||
<td class="normal"> * @param string|null $database
|
||||
</td></tr>
|
||||
<tr><td>176</td>
|
||||
<td class="normal"> * @return array
|
||||
</td></tr>
|
||||
<tr><td>177</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>178</td>
|
||||
<td class="normal"> public function listTables($database = null)
|
||||
</td></tr>
|
||||
<tr><td>179</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>180</td>
|
||||
<td class="covered"> $query = 'SELECT table_name FROM sys.user_tables';
|
||||
</td></tr>
|
||||
<tr><td>181</td>
|
||||
<td class="normal"> /**
|
||||
<td class="covered"> return $this->conn->fetchColumn($query);
|
||||
</td></tr>
|
||||
<tr><td>182</td>
|
||||
<td class="normal"> * lists table triggers
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>183</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>184</td>
|
||||
<td class="normal"> * @param string $table database table name
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>185</td>
|
||||
<td class="normal"> * @return array
|
||||
<td class="normal"> * lists table triggers
|
||||
</td></tr>
|
||||
<tr><td>186</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>187</td>
|
||||
<td class="normal"> public function listTableTriggers($table)
|
||||
</td></tr>
|
||||
<tr><td>188</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>189</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>190</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>191</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>192</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>193</td>
|
||||
<td class="normal"> * lists table views
|
||||
</td></tr>
|
||||
<tr><td>194</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>195</td>
|
||||
<td class="normal"> * @param string $table database table name
|
||||
</td></tr>
|
||||
<tr><td>196</td>
|
||||
<tr><td>188</td>
|
||||
<td class="normal"> * @return array
|
||||
</td></tr>
|
||||
<tr><td>197</td>
|
||||
<tr><td>189</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>198</td>
|
||||
<td class="normal"> public function listTableViews($table)
|
||||
<tr><td>190</td>
|
||||
<td class="normal"> public function listTableTriggers($table)
|
||||
</td></tr>
|
||||
<tr><td>199</td>
|
||||
<tr><td>191</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>200</td>
|
||||
<tr><td>192</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>201</td>
|
||||
<tr><td>193</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>202</td>
|
||||
<tr><td>194</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>203</td>
|
||||
<tr><td>195</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>204</td>
|
||||
<td class="normal"> * lists database users
|
||||
<tr><td>196</td>
|
||||
<td class="normal"> * lists table views
|
||||
</td></tr>
|
||||
<tr><td>205</td>
|
||||
<tr><td>197</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>206</td>
|
||||
<tr><td>198</td>
|
||||
<td class="normal"> * @param string $table database table name
|
||||
</td></tr>
|
||||
<tr><td>199</td>
|
||||
<td class="normal"> * @return array
|
||||
</td></tr>
|
||||
<tr><td>207</td>
|
||||
<tr><td>200</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>208</td>
|
||||
<td class="normal"> public function listUsers()
|
||||
<tr><td>201</td>
|
||||
<td class="normal"> public function listTableViews($table)
|
||||
</td></tr>
|
||||
<tr><td>209</td>
|
||||
<tr><td>202</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>210</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>211</td>
|
||||
<td class="normal"> if ($this->conn->options['emulate_database'] && $this->conn->options['database_name_prefix']) {
|
||||
</td></tr>
|
||||
<tr><td>212</td>
|
||||
<td class="normal"> $query = 'SELECT SUBSTR(username, ';
|
||||
</td></tr>
|
||||
<tr><td>213</td>
|
||||
<td class="normal"> $query.= (strlen($this->conn->options['database_name_prefix'])+1);
|
||||
</td></tr>
|
||||
<tr><td>214</td>
|
||||
<td class="normal"> $query.= ") FROM sys.dba_users WHERE username NOT LIKE '";
|
||||
</td></tr>
|
||||
<tr><td>215</td>
|
||||
<td class="normal"> $query.= $this->conn->options['database_name_prefix']."%'";
|
||||
</td></tr>
|
||||
<tr><td>216</td>
|
||||
<td class="normal"> } else {
|
||||
</td></tr>
|
||||
<tr><td>217</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>218</td>
|
||||
<tr><td>203</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>204</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>205</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>206</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>207</td>
|
||||
<td class="normal"> * lists database users
|
||||
</td></tr>
|
||||
<tr><td>208</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>209</td>
|
||||
<td class="normal"> * @return array
|
||||
</td></tr>
|
||||
<tr><td>210</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>211</td>
|
||||
<td class="normal"> public function listUsers()
|
||||
</td></tr>
|
||||
<tr><td>212</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>213</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>214</td>
|
||||
<td class="normal"> if ($this->conn->options['emulate_database'] && $this->conn->options['database_name_prefix']) {
|
||||
</td></tr>
|
||||
<tr><td>215</td>
|
||||
<td class="normal"> $query = 'SELECT SUBSTR(username, ';
|
||||
</td></tr>
|
||||
<tr><td>216</td>
|
||||
<td class="normal"> $query.= (strlen($this->conn->options['database_name_prefix'])+1);
|
||||
</td></tr>
|
||||
<tr><td>217</td>
|
||||
<td class="normal"> $query.= ") FROM sys.dba_users WHERE username NOT LIKE '";
|
||||
</td></tr>
|
||||
<tr><td>218</td>
|
||||
<td class="normal"> $query.= $this->conn->options['database_name_prefix']."%'";
|
||||
</td></tr>
|
||||
<tr><td>219</td>
|
||||
<td class="covered"> $query = 'SELECT username FROM sys.dba_users';
|
||||
<td class="normal"> } else {
|
||||
</td></tr>
|
||||
<tr><td>220</td>
|
||||
<td class="normal"> //}
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>221</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>222</td>
|
||||
<td class="covered"> return $this->conn->fetchColumn($query);
|
||||
<td class="covered"> $query = 'SELECT username FROM sys.dba_users';
|
||||
</td></tr>
|
||||
<tr><td>223</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal"> //}
|
||||
</td></tr>
|
||||
<tr><td>224</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>225</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>226</td>
|
||||
<td class="normal"> * lists database views
|
||||
</td></tr>
|
||||
<tr><td>227</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>228</td>
|
||||
<td class="normal"> * @param string|null $database
|
||||
</td></tr>
|
||||
<tr><td>229</td>
|
||||
<td class="normal"> * @return array
|
||||
</td></tr>
|
||||
<tr><td>230</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>231</td>
|
||||
<td class="normal"> public function listViews($database = null)
|
||||
</td></tr>
|
||||
<tr><td>232</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>233</td>
|
||||
<td class="covered"> $query = 'SELECT view_name FROM sys.user_views';
|
||||
</td></tr>
|
||||
<tr><td>234</td>
|
||||
<td class="covered"> return $this->conn->fetchColumn($query);
|
||||
</td></tr>
|
||||
<tr><td>235</td>
|
||||
<tr><td>226</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>227</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>228</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>229</td>
|
||||
<td class="normal"> * lists database views
|
||||
</td></tr>
|
||||
<tr><td>230</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>231</td>
|
||||
<td class="normal"> * @param string|null $database
|
||||
</td></tr>
|
||||
<tr><td>232</td>
|
||||
<td class="normal"> * @return array
|
||||
</td></tr>
|
||||
<tr><td>233</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>234</td>
|
||||
<td class="normal"> public function listViews($database = null)
|
||||
</td></tr>
|
||||
<tr><td>235</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>236</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<td class="covered"> $query = 'SELECT view_name FROM sys.user_views';
|
||||
</td></tr>
|
||||
<tr><td>237</td>
|
||||
<td class="covered"> return $this->conn->fetchColumn($query);
|
||||
</td></tr>
|
||||
<tr><td>238</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>239</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Lib.php 3016 2007-10-26 09:56:31Z meus $
|
||||
<td class="normal"> * $Id: Lib.php 3189 2007-11-18 20:37:44Z meus $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 3016 $
|
||||
<td class="normal"> * @version $Revision: 3189 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -679,123 +679,135 @@
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>224</td>
|
||||
<td class="normal"> * @return string
|
||||
<td class="normal"> * formatSql
|
||||
</td></tr>
|
||||
<tr><td>225</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>226</td>
|
||||
<td class="normal"> public static function formatSql($sql)
|
||||
<td class="normal"> * @todo: What about creating a config varialbe for the color?
|
||||
</td></tr>
|
||||
<tr><td>227</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * @param mixed $sql
|
||||
</td></tr>
|
||||
<tr><td>228</td>
|
||||
<td class="red"> $e = explode("\n",$sql);
|
||||
<td class="normal"> * @return string the formated sql
|
||||
</td></tr>
|
||||
<tr><td>229</td>
|
||||
<td class="red"> $color = "367FAC";
|
||||
</td></tr>
|
||||
<tr><td>230</td>
|
||||
<td class="red"> $l = $sql;
|
||||
</td></tr>
|
||||
<tr><td>231</td>
|
||||
<td class="red"> $l = str_replace("SELECT ", "<font color='$color'><b>SELECT </b></font><br \> ",$l);
|
||||
</td></tr>
|
||||
<tr><td>232</td>
|
||||
<td class="red"> $l = str_replace("FROM ", "<font color='$color'><b>FROM </b></font><br \>",$l);
|
||||
</td></tr>
|
||||
<tr><td>233</td>
|
||||
<td class="red"> $l = str_replace(" LEFT JOIN ", "<br \><font color='$color'><b> LEFT JOIN </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>234</td>
|
||||
<td class="red"> $l = str_replace(" INNER JOIN ", "<br \><font color='$color'><b> INNER JOIN </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>235</td>
|
||||
<td class="red"> $l = str_replace(" WHERE ", "<br \><font color='$color'><b> WHERE </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>236</td>
|
||||
<td class="red"> $l = str_replace(" GROUP BY ", "<br \><font color='$color'><b> GROUP BY </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>237</td>
|
||||
<td class="red"> $l = str_replace(" HAVING ", "<br \><font color='$color'><b> HAVING </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>238</td>
|
||||
<td class="red"> $l = str_replace(" AS ", "<font color='$color'><b> AS </b></font><br \> ",$l);
|
||||
</td></tr>
|
||||
<tr><td>239</td>
|
||||
<td class="red"> $l = str_replace(" ON ", "<font color='$color'><b> ON </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>240</td>
|
||||
<td class="red"> $l = str_replace(" ORDER BY ", "<font color='$color'><b> ORDER BY </b></font><br \>",$l);
|
||||
</td></tr>
|
||||
<tr><td>241</td>
|
||||
<td class="red"> $l = str_replace(" LIMIT ", "<font color='$color'><b> LIMIT </b></font><br \>",$l);
|
||||
</td></tr>
|
||||
<tr><td>242</td>
|
||||
<td class="red"> $l = str_replace(" OFFSET ", "<font color='$color'><b> OFFSET </b></font><br \>",$l);
|
||||
</td></tr>
|
||||
<tr><td>243</td>
|
||||
<td class="red"> $l = str_replace(" ", "<dd>",$l);
|
||||
</td></tr>
|
||||
<tr><td>244</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>245</td>
|
||||
<td class="red"> return $l;
|
||||
</td></tr>
|
||||
<tr><td>246</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>247</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>248</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>249</td>
|
||||
<td class="normal"> * returns a string representation of Doctrine_Collection object
|
||||
</td></tr>
|
||||
<tr><td>250</td>
|
||||
<td class="normal"> * @param Doctrine_Collection $collection
|
||||
</td></tr>
|
||||
<tr><td>251</td>
|
||||
<td class="normal"> * @return string
|
||||
</td></tr>
|
||||
<tr><td>252</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>253</td>
|
||||
<td class="normal"> public static function getCollectionAsString(Doctrine_Collection $collection)
|
||||
<tr><td>230</td>
|
||||
<td class="normal"> public static function formatSql($sql)
|
||||
</td></tr>
|
||||
<tr><td>254</td>
|
||||
<tr><td>231</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>255</td>
|
||||
<td class="red"> $r[] = "<pre>";
|
||||
<tr><td>232</td>
|
||||
<td class="red"> $e = explode("\n",$sql);
|
||||
</td></tr>
|
||||
<tr><td>256</td>
|
||||
<td class="red"> $r[] = get_class($collection);
|
||||
<tr><td>233</td>
|
||||
<td class="red"> $color = "367FAC";
|
||||
</td></tr>
|
||||
<tr><td>257</td>
|
||||
<td class="red"> $r[] = 'data : ' . Doctrine::dump($collection->getData(), false);
|
||||
<tr><td>234</td>
|
||||
<td class="red"> $l = $sql;
|
||||
</td></tr>
|
||||
<tr><td>258</td>
|
||||
<td class="normal"> //$r[] = 'snapshot : ' . Doctrine::dump($collection->getSnapshot());
|
||||
<tr><td>235</td>
|
||||
<td class="red"> $l = str_replace("SELECT ", "<font color='$color'><b>SELECT </b></font><br \> ",$l);
|
||||
</td></tr>
|
||||
<tr><td>259</td>
|
||||
<tr><td>236</td>
|
||||
<td class="red"> $l = str_replace("FROM ", "<font color='$color'><b>FROM </b></font><br \>",$l);
|
||||
</td></tr>
|
||||
<tr><td>237</td>
|
||||
<td class="red"> $l = str_replace(" LEFT JOIN ", "<br \><font color='$color'><b> LEFT JOIN </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>238</td>
|
||||
<td class="red"> $l = str_replace(" INNER JOIN ", "<br \><font color='$color'><b> INNER JOIN </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>239</td>
|
||||
<td class="red"> $l = str_replace(" WHERE ", "<br \><font color='$color'><b> WHERE </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>240</td>
|
||||
<td class="red"> $l = str_replace(" GROUP BY ", "<br \><font color='$color'><b> GROUP BY </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>241</td>
|
||||
<td class="red"> $l = str_replace(" HAVING ", "<br \><font color='$color'><b> HAVING </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>242</td>
|
||||
<td class="red"> $l = str_replace(" AS ", "<font color='$color'><b> AS </b></font><br \> ",$l);
|
||||
</td></tr>
|
||||
<tr><td>243</td>
|
||||
<td class="red"> $l = str_replace(" ON ", "<font color='$color'><b> ON </b></font>",$l);
|
||||
</td></tr>
|
||||
<tr><td>244</td>
|
||||
<td class="red"> $l = str_replace(" ORDER BY ", "<font color='$color'><b> ORDER BY </b></font><br \>",$l);
|
||||
</td></tr>
|
||||
<tr><td>245</td>
|
||||
<td class="red"> $l = str_replace(" LIMIT ", "<font color='$color'><b> LIMIT </b></font><br \>",$l);
|
||||
</td></tr>
|
||||
<tr><td>246</td>
|
||||
<td class="red"> $l = str_replace(" OFFSET ", "<font color='$color'><b> OFFSET </b></font><br \>",$l);
|
||||
</td></tr>
|
||||
<tr><td>247</td>
|
||||
<td class="red"> $l = str_replace(" ", "<dd>",$l);
|
||||
</td></tr>
|
||||
<tr><td>248</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>260</td>
|
||||
<td class="red"> $r[] = "</pre>";
|
||||
<tr><td>249</td>
|
||||
<td class="red"> return $l;
|
||||
</td></tr>
|
||||
<tr><td>261</td>
|
||||
<td class="red"> return implode("\n",$r);
|
||||
</td></tr>
|
||||
<tr><td>262</td>
|
||||
<tr><td>250</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>251</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>252</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>253</td>
|
||||
<td class="normal"> * returns a string representation of Doctrine_Collection object
|
||||
</td></tr>
|
||||
<tr><td>254</td>
|
||||
<td class="normal"> * @param Doctrine_Collection $collection
|
||||
</td></tr>
|
||||
<tr><td>255</td>
|
||||
<td class="normal"> * @return string
|
||||
</td></tr>
|
||||
<tr><td>256</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>257</td>
|
||||
<td class="normal"> public static function getCollectionAsString(Doctrine_Collection $collection)
|
||||
</td></tr>
|
||||
<tr><td>258</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>259</td>
|
||||
<td class="red"> $r[] = "<pre>";
|
||||
</td></tr>
|
||||
<tr><td>260</td>
|
||||
<td class="red"> $r[] = get_class($collection);
|
||||
</td></tr>
|
||||
<tr><td>261</td>
|
||||
<td class="red"> $r[] = 'data : ' . Doctrine::dump($collection->getData(), false);
|
||||
</td></tr>
|
||||
<tr><td>262</td>
|
||||
<td class="normal"> //$r[] = 'snapshot : ' . Doctrine::dump($collection->getSnapshot());
|
||||
</td></tr>
|
||||
<tr><td>263</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>264</td>
|
||||
<td class="red"> $r[] = "</pre>";
|
||||
</td></tr>
|
||||
<tr><td>265</td>
|
||||
<td class="red"> return implode("\n",$r);
|
||||
</td></tr>
|
||||
<tr><td>266</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>267</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -217,7 +217,7 @@
|
||||
<td class="covered"> $class = 'Doctrine_Parser_'.ucfirst($type);
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="covered"> return new $class;
|
||||
@ -268,7 +268,7 @@
|
||||
<td class="covered"> $parser = self::getParser($type);
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="covered"> return $parser->loadData($path);
|
||||
@ -322,7 +322,7 @@
|
||||
<td class="covered"> $parser = self::getParser($type);
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="covered"> return $parser->dumpData($array, $path);
|
||||
@ -373,22 +373,22 @@
|
||||
<td class="covered"> if ( ! file_exists($path)) {
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="red"> $contents = $path;
|
||||
<td class="covered"> $contents = $path;
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="red"> $path = '/tmp/dparser_' . microtime();
|
||||
<td class="covered"> $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'dparser_' . microtime();
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="red"> file_put_contents($path, $contents);
|
||||
<td class="covered"> file_put_contents($path, $contents);
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="red"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> include($path);
|
||||
@ -397,7 +397,7 @@
|
||||
<td class="covered"> $contents = ob_get_clean();
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="covered"> return $contents;
|
||||
@ -406,32 +406,53 @@
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="normal"> public function doDump($data, $path)
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * doDump
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="covered"> if ($path) {
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="covered"> return file_put_contents($path, $data);
|
||||
<td class="normal"> * @param string $data
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="orange"> } else {
|
||||
<td class="normal"> * @param string $path
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="red"> return $data;
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="normal"> }
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal"> public function doDump($data, $path = null)
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="covered"> if ($path !== null) {
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="covered"> return file_put_contents($path, $data);
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="orange"> } else {
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="covered"> return $data;
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="covered">}</td></tr>
|
||||
</table></body></html>
|
@ -106,7 +106,7 @@
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>33</td>
|
||||
<td class="normal">class Doctrine_Plugin
|
||||
<td class="normal">abstract class Doctrine_Plugin
|
||||
</td></tr>
|
||||
<tr><td>34</td>
|
||||
<td class="covered">{
|
||||
@ -124,437 +124,606 @@
|
||||
<td class="normal"> protected $_options = array('generateFiles' => false,
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal"> 'identifier' => false);
|
||||
<td class="normal"> 'identifier' => false,
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> 'generateFiles' => false,
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal"> 'table' => false,
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal"> * __get
|
||||
<td class="normal"> 'pluginTable' => false,
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> * an alias for getOption
|
||||
<td class="normal"> 'children' => array(),);
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> * @param string $option
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * __get
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> public function __get($option)
|
||||
<td class="normal"> * an alias for getOption
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="red"> if (isset($this->_options[$option])) {
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="red"> return $this->_options[$option];
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="red"> return null;
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal"> * __isset
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> * @param string $option
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> public function __isset($option)
|
||||
<tr><td>51</td>
|
||||
<td class="normal"> public function __get($option)
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<tr><td>52</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="red"> return isset($this->_options[$option]);
|
||||
<tr><td>53</td>
|
||||
<td class="red"> if (isset($this->_options[$option])) {
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="orange"> }
|
||||
<tr><td>54</td>
|
||||
<td class="red"> return $this->_options[$option];
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> * returns the value of an option
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> * @param $option the name of the option to retrieve
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> * @return mixed the value of the option
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal"> public function getOption($name)
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="covered"> if ( ! isset($this->_options[$name])) {
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="red"> throw new Doctrine_Plugin_Exception('Unknown option ' . $name);
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<tr><td>55</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="red"> return null;
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> * __isset
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="normal"> * @param string $option
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> public function __isset($option)
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="red"> return isset($this->_options[$option]);
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> * returns the value of an option
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="normal"> * @param $option the name of the option to retrieve
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal"> * @return mixed the value of the option
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="normal"> public function getOption($name)
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="covered"> return $this->_options[$name];
|
||||
<td class="covered"> if ( ! isset($this->_options[$name])) {
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="orange"> }
|
||||
<td class="red"> throw new Doctrine_Plugin_Exception('Unknown option ' . $name);
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="normal">
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="normal"> * sets given value to an option
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="normal"> * @param $option the name of the option to be changed
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> * @param $value the value of the option
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal"> * @return Doctrine_Plugin this object
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="normal"> public function setOption($name, $value)
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="covered"> $this->_options[$name] = $value;
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="covered"> return $this->_options[$name];
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal"> * sets given value to an option
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="normal"> * @param $option the name of the option to be changed
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal"> * @param $value the value of the option
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> * @return Doctrine_Plugin this object
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="covered"> return $this;
|
||||
<td class="normal"> public function setOption($name, $value)
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="normal"> * returns all options and their associated values
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="normal"> * @return array all options as an associative array
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal"> public function getOptions()
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="red"> return $this->_options;
|
||||
<tr><td>93</td>
|
||||
<td class="covered"> $this->_options[$name] = $value;
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<tr><td>94</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="covered"> return $this;
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<tr><td>97</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<tr><td>98</td>
|
||||
<td class="normal"> public function addChild(Doctrine_Template $template)
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="covered"> $this->_options['children'][] = $template;
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="normal"> * returns all options and their associated values
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="normal"> * generates foreign keys for the plugin table based on the owner table
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * @return array all options as an associative array
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal"> * the foreign keys generated by this method can be used for
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="normal"> * setting the relations between the owner and the plugin classes
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="normal"> * @param Doctrine_Table $table the table object that owns the plugin
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="normal"> * @return array an array of foreign key definitions
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="normal"> public function getOptions()
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="red"> return $this->_options;
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="normal"> public function generateForeignKeys(Doctrine_Table $table)
|
||||
<td class="normal"> public function buildPluginDefinition(Doctrine_Table $table)
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="covered"> $fk = array();
|
||||
<td class="covered"> $this->_options['table'] = $table;
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="covered"> foreach ((array) $table->getIdentifier() as $column) {
|
||||
<td class="covered"> $this->_options['className'] = str_replace('%CLASS%',
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="covered"> $def = $table->getDefinitionOf($column);
|
||||
<td class="covered"> $this->_options['table']->getComponentName(),
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $this->_options['className']);
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="covered"> unset($def['autoincrement']);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="covered"> unset($def['sequence']);
|
||||
<td class="normal"> // check that class doesn't exist (otherwise we cannot create it)
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="covered"> unset($def['primary']);
|
||||
<td class="covered"> if (class_exists($this->_options['className'])) {
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="normal">
|
||||
<td class="red"> return false;
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="covered"> $col = $column;
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="covered"> $def['primary'] = true;
|
||||
<td class="covered"> $this->buildDefinition();
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="covered"> $fk[$col] = $def;
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> }
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="covered"> return $fk;
|
||||
<td class="normal"> abstract public function buildDefinition();
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="normal"> public function buildForeignKeys(Doctrine_Table $table)
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="normal"> * generates a relation array to given table
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="normal"> * this method can be used for generating the relation from the plugin
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="normal"> * table to the owner table
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="normal"> * @param Doctrine_Table $table the table object to construct the relation to
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="normal"> * @param array $foreignKeys an array of foreign keys
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="normal"> * @return array the generated relation array
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="normal"> public function generateRelation(Doctrine_Table $table, array $foreignKeys)
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="covered"> $id = $table->getIdentifier();
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="covered"> $fk = array();
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="covered"> foreach ((array) $id as $column) {
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="covered"> $def = $table->getDefinitionOf($column);
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="covered"> unset($def['autoincrement']);
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="covered"> unset($def['sequence']);
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="covered"> unset($def['unique']);
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="covered"> $fk[$column] = $def;
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="covered"> $local = (count($foreignKeys) > 1) ? array_keys($foreignKeys) : key($foreignKeys);
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="covered"> $relation = array($table->getComponentName() =>
|
||||
<td class="covered"> return $fk;
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="covered"> array('local' => $local,
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="covered"> 'foreign' => $table->getIdentifier(),
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="covered"> 'onDelete' => 'CASCADE',
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="covered"> 'onUpdate' => 'CASCADE'));
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="covered"> return $relation;
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<tr><td>148</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<td class="normal"> /**
|
||||
<tr><td>149</td>
|
||||
<td class="normal"> public function generateChildDefinitions()
|
||||
</td></tr>
|
||||
<tr><td>156</td>
|
||||
<td class="normal"> * generates the class definition for plugin class
|
||||
</td></tr>
|
||||
<tr><td>157</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>158</td>
|
||||
<td class="normal"> * @param array $options plugin class options, keys representing the option names
|
||||
</td></tr>
|
||||
<tr><td>159</td>
|
||||
<td class="normal"> * and values as option values
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<td class="normal"> * @param array $columns the plugin class columns, keys representing the column names
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="normal"> * and values as column definitions
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<td class="normal"> * @param array $relations the bound relations of the plugin class
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="normal"> public function generateClass($options, $columns, $relations)
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<tr><td>150</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="covered"> $builder = new Doctrine_Import_Builder();
|
||||
<tr><td>151</td>
|
||||
<td class="covered"> foreach ($this->_options['children'] as $child) {
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<tr><td>152</td>
|
||||
<td class="covered"> $this->_options['pluginTable']->addTemplate(get_class($child), $child);
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<td class="covered"> $child->setTable($this->_options['pluginTable']);
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>156</td>
|
||||
<td class="covered"> $child->setUp();
|
||||
</td></tr>
|
||||
<tr><td>157</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>158</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>159</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="normal"> * generates foreign keys for the plugin table based on the owner table
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="normal"> * the foreign keys generated by this method can be used for
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<td class="normal"> * setting the relations between the owner and the plugin classes
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="normal"> * @param Doctrine_Table $table the table object that owns the plugin
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="normal"> * @return array an array of foreign key definitions
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="covered"> if ($this->_options['generateFiles']) {
|
||||
<td class="normal"> public function generateForeignKeys(Doctrine_Table $table)
|
||||
</td></tr>
|
||||
<tr><td>170</td>
|
||||
<td class="red"> if (isset($this->_options['generatePath']) && $this->_options['generatePath']) {
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>171</td>
|
||||
<td class="red"> $builder->setTargetPath($this->_options['generatePath']);
|
||||
<td class="covered"> $fk = array();
|
||||
</td></tr>
|
||||
<tr><td>172</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>173</td>
|
||||
<td class="red"> $builder->buildRecord($options, $columns, $relations);
|
||||
<td class="covered"> foreach ((array) $table->getIdentifier() as $column) {
|
||||
</td></tr>
|
||||
<tr><td>174</td>
|
||||
<td class="red"> } else {
|
||||
<td class="covered"> $def = $table->getDefinitionOf($column);
|
||||
</td></tr>
|
||||
<tr><td>175</td>
|
||||
<td class="red"> throw new Doctrine_Plugin_Exception('If you wish to generate files then you must specify the path to generate the files in.');
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>176</td>
|
||||
<td class="normal"> }
|
||||
<td class="covered"> unset($def['autoincrement']);
|
||||
</td></tr>
|
||||
<tr><td>177</td>
|
||||
<td class="red"> } else {
|
||||
<td class="covered"> unset($def['sequence']);
|
||||
</td></tr>
|
||||
<tr><td>178</td>
|
||||
<td class="covered"> $def = $builder->buildDefinition($options, $columns, $relations);
|
||||
<td class="covered"> unset($def['primary']);
|
||||
</td></tr>
|
||||
<tr><td>179</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>180</td>
|
||||
<td class="covered"> eval($def);
|
||||
<td class="covered"> $col = $column;
|
||||
</td></tr>
|
||||
<tr><td>181</td>
|
||||
<td class="normal"> }
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>182</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $def['primary'] = true;
|
||||
</td></tr>
|
||||
<tr><td>183</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<td class="covered"> $fk[$col] = $def;
|
||||
</td></tr>
|
||||
<tr><td>184</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>185</td>
|
||||
<td class="covered"> return $fk;
|
||||
</td></tr>
|
||||
<tr><td>186</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>187</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>188</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>189</td>
|
||||
<td class="normal"> * generates a relation array to given table
|
||||
</td></tr>
|
||||
<tr><td>190</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>191</td>
|
||||
<td class="normal"> * this method can be used for generating the relation from the plugin
|
||||
</td></tr>
|
||||
<tr><td>192</td>
|
||||
<td class="normal"> * table to the owner table
|
||||
</td></tr>
|
||||
<tr><td>193</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>194</td>
|
||||
<td class="normal"> * @param Doctrine_Table $table the table object to construct the relation to
|
||||
</td></tr>
|
||||
<tr><td>195</td>
|
||||
<td class="normal"> * @param array $foreignKeys an array of foreign keys
|
||||
</td></tr>
|
||||
<tr><td>196</td>
|
||||
<td class="normal"> * @return array the generated relation array
|
||||
</td></tr>
|
||||
<tr><td>197</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>198</td>
|
||||
<td class="normal"> public function generateRelation(Doctrine_Table $table, array $foreignKeys)
|
||||
</td></tr>
|
||||
<tr><td>199</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>200</td>
|
||||
<td class="covered"> $local = (count($foreignKeys) > 1) ? array_keys($foreignKeys) : key($foreignKeys);
|
||||
</td></tr>
|
||||
<tr><td>201</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>202</td>
|
||||
<td class="covered"> $relation = array($table->getComponentName() =>
|
||||
</td></tr>
|
||||
<tr><td>203</td>
|
||||
<td class="covered"> array('local' => $local,
|
||||
</td></tr>
|
||||
<tr><td>204</td>
|
||||
<td class="covered"> 'foreign' => $table->getIdentifier(),
|
||||
</td></tr>
|
||||
<tr><td>205</td>
|
||||
<td class="covered"> 'onDelete' => 'CASCADE',
|
||||
</td></tr>
|
||||
<tr><td>206</td>
|
||||
<td class="covered"> 'onUpdate' => 'CASCADE'));
|
||||
</td></tr>
|
||||
<tr><td>207</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>208</td>
|
||||
<td class="covered"> return $relation;
|
||||
</td></tr>
|
||||
<tr><td>209</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>210</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>211</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>212</td>
|
||||
<td class="normal"> * generates the class definition for plugin class
|
||||
</td></tr>
|
||||
<tr><td>213</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>214</td>
|
||||
<td class="normal"> * @param array $options plugin class options, keys representing the option names
|
||||
</td></tr>
|
||||
<tr><td>215</td>
|
||||
<td class="normal"> * and values as option values
|
||||
</td></tr>
|
||||
<tr><td>216</td>
|
||||
<td class="normal"> * @param array $columns the plugin class columns, keys representing the column names
|
||||
</td></tr>
|
||||
<tr><td>217</td>
|
||||
<td class="normal"> * and values as column definitions
|
||||
</td></tr>
|
||||
<tr><td>218</td>
|
||||
<td class="normal"> * @param array $relations the bound relations of the plugin class
|
||||
</td></tr>
|
||||
<tr><td>219</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>220</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>221</td>
|
||||
<td class="normal"> public function generateClass($options, $columns, $relations)
|
||||
</td></tr>
|
||||
<tr><td>222</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>223</td>
|
||||
<td class="covered"> $builder = new Doctrine_Import_Builder();
|
||||
</td></tr>
|
||||
<tr><td>224</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>225</td>
|
||||
<td class="covered"> if ($this->_options['generateFiles']) {
|
||||
</td></tr>
|
||||
<tr><td>226</td>
|
||||
<td class="red"> if (isset($this->_options['generatePath']) && $this->_options['generatePath']) {
|
||||
</td></tr>
|
||||
<tr><td>227</td>
|
||||
<td class="red"> $builder->setTargetPath($this->_options['generatePath']);
|
||||
</td></tr>
|
||||
<tr><td>228</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>229</td>
|
||||
<td class="red"> $builder->buildRecord($options, $columns, $relations);
|
||||
</td></tr>
|
||||
<tr><td>230</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>231</td>
|
||||
<td class="red"> throw new Doctrine_Plugin_Exception('If you wish to generate files then you must specify the path to generate the files in.');
|
||||
</td></tr>
|
||||
<tr><td>232</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>233</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>234</td>
|
||||
<td class="covered"> $def = $builder->buildDefinition($options, $columns, $relations);
|
||||
</td></tr>
|
||||
<tr><td>235</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>236</td>
|
||||
<td class="covered"> eval($def);
|
||||
</td></tr>
|
||||
<tr><td>237</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>238</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>239</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -142,365 +142,377 @@
|
||||
<td class="normal"> protected $sql;
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal"> protected $_tokenizer;
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> * @param Doctrine_Table|string $table Doctrine_Table object
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> public function __construct($table)
|
||||
<td class="normal"> * @param Doctrine_Table|string $table Doctrine_Table object
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="covered"> if ( ! ($table instanceof Doctrine_Table)) {
|
||||
<td class="normal"> public function __construct($table)
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="covered"> $table = Doctrine_Manager::getInstance()
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="covered"> ->getCurrentConnection()
|
||||
<td class="covered"> if ( ! ($table instanceof Doctrine_Table)) {
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="covered"> ->getTable($table);
|
||||
<td class="covered"> $table = Doctrine_Manager::getInstance()
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> ->getCurrentConnection()
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="covered"> $this->table = $table;
|
||||
<td class="covered"> ->getTable($table);
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $this->table = $table;
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> /**
|
||||
<td class="covered"> $this->_tokenizer = new Doctrine_Query_Tokenizer();
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> * getTable
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal"> * returns the table object associated with this object
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> * @return Doctrine_Connection
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> public function getTable()
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="red"> return $this->table;
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal"> * parse
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal"> * @param string $dql DQL CHECK constraint definition
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="normal"> * @return string
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="normal"> public function parse($dql)
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="covered"> $this->sql = $this->parseClause($dql);
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<tr><td>61</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<tr><td>62</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal"> * parseClause
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> * getTable
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> * returns the table object associated with this object
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> * @param string $alias component alias
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> * @return Doctrine_Connection
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal"> * @param string $field the field name
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="normal"> * @param mixed $value the value of the field
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<tr><td>67</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> public function parseClause($dql)
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> public function getTable()
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="covered"> $parts = Doctrine_Tokenizer::sqlExplode($dql, ' AND ');
|
||||
<tr><td>70</td>
|
||||
<td class="red"> return $this->table;
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="covered"> if (count($parts) > 1) {
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="red"> $ret = array();
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="red"> foreach ($parts as $part) {
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="red"> $ret[] = $this->parseSingle($part);
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="red"> $r = implode(' AND ', $ret);
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="covered"> $parts = Doctrine_Tokenizer::quoteExplode($dql, ' OR ');
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="covered"> if (count($parts) > 1) {
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="red"> $ret = array();
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="red"> foreach ($parts as $part) {
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="red"> $ret[] = $this->parseClause($part);
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="red"> $r = implode(' OR ', $ret);
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="covered"> $ret = $this->parseSingle($dql);
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="covered"> return $ret;
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="red"> return '(' . $r . ')';
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<tr><td>71</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="normal"> public function parseSingle($part)
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="covered"> $e = explode(' ', $part);
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="covered"> $e[0] = $this->parseFunction($e[0]);
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<tr><td>72</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="covered"> switch ($e[1]) {
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="covered"> case '>':
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="covered"> case '<':
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="covered"> case '=':
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="covered"> case '!=':
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="covered"> case '<>':
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="covered"> default:
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="covered"> throw new Doctrine_Query_Exception('Unknown operator ' . $e[1]);
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="covered"> return implode(' ', $e);
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="normal"> public function parseFunction($dql)
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="covered"> if (($pos = strpos($dql, '(')) !== false) {
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="covered"> $func = substr($dql, 0, $pos);
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="covered"> $value = substr($dql, ($pos + 1), -1);
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="covered"> $expr = $this->table->getConnection()->expression;
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="covered"> if ( ! method_exists($expr, $func)) {
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="covered"> throw new Doctrine_Query_Exception('Unknown function ' . $func);
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="covered"> $func = $expr->$func($value);
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="covered"> return $func;
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<tr><td>73</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<td class="normal"> * getSql
|
||||
<tr><td>74</td>
|
||||
<td class="normal"> * parse
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<tr><td>75</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>156</td>
|
||||
<td class="normal"> * returns database specific sql CHECK constraint definition
|
||||
<tr><td>76</td>
|
||||
<td class="normal"> * @param string $dql DQL CHECK constraint definition
|
||||
</td></tr>
|
||||
<tr><td>157</td>
|
||||
<td class="normal"> * parsed from the given dql CHECK definition
|
||||
</td></tr>
|
||||
<tr><td>158</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>159</td>
|
||||
<tr><td>77</td>
|
||||
<td class="normal"> * @return string
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<tr><td>78</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="normal"> public function getSql()
|
||||
<tr><td>79</td>
|
||||
<td class="normal"> public function parse($dql)
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<tr><td>80</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="covered"> return $this->sql;
|
||||
<tr><td>81</td>
|
||||
<td class="covered"> $this->sql = $this->parseClause($dql);
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<tr><td>82</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal"> * parseClause
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="normal"> * @param string $alias component alias
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal"> * @param string $field the field name
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> * @param mixed $value the value of the field
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal"> public function parseClause($dql)
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="covered"> $parts = $this->_tokenizer->sqlExplode($dql, ' AND ');
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="covered"> if (count($parts) > 1) {
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="red"> $ret = array();
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="red"> foreach ($parts as $part) {
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="red"> $ret[] = $this->parseSingle($part);
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="red"> $r = implode(' AND ', $ret);
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="covered"> $parts = $this->_tokenizer->quoteExplode($dql, ' OR ');
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="covered"> if (count($parts) > 1) {
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="red"> $ret = array();
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="red"> foreach ($parts as $part) {
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="red"> $ret[] = $this->parseClause($part);
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="red"> $r = implode(' OR ', $ret);
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="red"> } else {
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="covered"> $ret = $this->parseSingle($dql);
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="covered"> return $ret;
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="red"> return '(' . $r . ')';
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="normal"> public function parseSingle($part)
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="covered"> $e = explode(' ', $part);
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="covered"> $e[0] = $this->parseFunction($e[0]);
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="covered"> switch ($e[1]) {
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="covered"> case '>':
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> case '<':
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="covered"> case '=':
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="covered"> case '!=':
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="covered"> case '<>':
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="covered"> default:
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="covered"> throw new Doctrine_Query_Exception('Unknown operator ' . $e[1]);
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="covered"> return implode(' ', $e);
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="normal"> public function parseFunction($dql)
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="covered"> if (($pos = strpos($dql, '(')) !== false) {
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="covered"> $func = substr($dql, 0, $pos);
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="covered"> $value = substr($dql, ($pos + 1), -1);
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="covered"> $expr = $this->table->getConnection()->expression;
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="covered"> if ( ! method_exists($expr, $func)) {
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="covered"> throw new Doctrine_Query_Exception('Unknown function ' . $func);
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="covered"> $func = $expr->$func($value);
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<td class="covered"> return $func;
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>156</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>157</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>158</td>
|
||||
<td class="normal"> * getSql
|
||||
</td></tr>
|
||||
<tr><td>159</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<td class="normal"> * returns database specific sql CHECK constraint definition
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="normal"> * parsed from the given dql CHECK definition
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="normal"> * @return string
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="normal"> public function getSql()
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="covered"> return $this->sql;
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="covered">}</td></tr>
|
||||
</table></body></html>
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Condition.php 3032 2007-10-29 19:50:16Z meus $
|
||||
<td class="normal"> * $Id: Condition.php 3212 2007-11-24 18:58:33Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 3032 $
|
||||
<td class="normal"> * @version $Revision: 3212 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -145,7 +145,7 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="covered"> $parts = Doctrine_Tokenizer::bracketExplode($str, array(' \&\& ', ' AND '), '(', ')');
|
||||
<td class="covered"> $parts = $this->_tokenizer->bracketExplode($str, array(' \&\& ', ' AND '), '(', ')');
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal">
|
||||
@ -160,7 +160,7 @@
|
||||
<td class="covered"> foreach ($parts as $part) {
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="covered"> $part = Doctrine_Tokenizer::bracketTrim($part, '(', ')');
|
||||
<td class="covered"> $part = $this->_tokenizer->bracketTrim($part, '(', ')');
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="covered"> $ret[] = $this->parse($part);
|
||||
@ -178,7 +178,7 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="covered"> $parts = Doctrine_Tokenizer::bracketExplode($str, array(' \|\| ', ' OR '), '(', ')');
|
||||
<td class="covered"> $parts = $this->_tokenizer->bracketExplode($str, array(' \|\| ', ' OR '), '(', ')');
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="covered"> if (count($parts) > 1) {
|
||||
@ -190,7 +190,7 @@
|
||||
<td class="covered"> foreach ($parts as $part) {
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="covered"> $part = Doctrine_Tokenizer::bracketTrim($part, '(', ')');
|
||||
<td class="covered"> $part = $this->_tokenizer->bracketTrim($part, '(', ')');
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> $ret[] = $this->parse($part);
|
||||
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: From.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: From.php 3212 2007-11-24 18:58:33Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 2702 $
|
||||
<td class="normal"> * @version $Revision: 3212 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -118,10 +118,10 @@
|
||||
<td class="normal"> * DQL FROM PARSER
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="normal"> * parses the from part of the query string
|
||||
<td class="normal"> * parses the FROM part of the query string
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal"> * @param string $str
|
||||
@ -136,13 +136,13 @@
|
||||
<td class="normal"> public function parse($str)
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="covered"> $str = trim($str);
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="covered"> $parts = Doctrine_Tokenizer::bracketExplode($str, 'JOIN');
|
||||
<td class="covered"> $parts = $this->_tokenizer->bracketExplode($str, 'JOIN');
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal">
|
||||
@ -178,104 +178,101 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="covered"> $last = '';
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<tr><td>58</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<tr><td>59</td>
|
||||
<td class="covered"> foreach ($parts as $k => $part) {
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<tr><td>60</td>
|
||||
<td class="covered"> $part = trim($part);
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<tr><td>61</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> if (empty($part)) {
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<tr><td>63</td>
|
||||
<td class="red"> continue;
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<tr><td>64</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<tr><td>65</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="covered"> $e = explode(' ', $part);
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="covered"> $e = explode(' ', $part);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="covered"> if (end($e) == 'INNER' || end($e) == 'LEFT') {
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<tr><td>69</td>
|
||||
<td class="covered"> $last = array_pop($e);
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<tr><td>70</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<tr><td>71</td>
|
||||
<td class="covered"> $part = implode(' ', $e);
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<tr><td>72</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="covered"> foreach ($this->_tokenizer->bracketExplode($part, ',') as $reference) {
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="covered"> foreach (Doctrine_Tokenizer::bracketExplode($part, ',') as $reference) {
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="covered"> $reference = trim($reference);
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<tr><td>75</td>
|
||||
<td class="covered"> $e = explode(' ', $reference);
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<tr><td>76</td>
|
||||
<td class="covered"> $e2 = explode('.', $e[0]);
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<tr><td>77</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<tr><td>78</td>
|
||||
<td class="covered"> if ($operator) {
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<tr><td>79</td>
|
||||
<td class="covered"> $e[0] = array_shift($e2) . $operator . implode('.', $e2);
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<tr><td>80</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal">
|
||||
<tr><td>81</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<tr><td>82</td>
|
||||
<td class="covered"> $table = $this->query->load(implode(' ', $e));
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<tr><td>83</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<tr><td>84</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<tr><td>85</td>
|
||||
<td class="covered"> $operator = ($last == 'INNER') ? ':' : '.';
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<tr><td>86</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<tr><td>87</td>
|
||||
<td class="covered"> return null;
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<tr><td>88</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<tr><td>89</td>
|
||||
<td class="covered">}</td></tr>
|
||||
</table></body></html>
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Having.php 3032 2007-10-29 19:50:16Z meus $
|
||||
<td class="normal"> * $Id: Having.php 3212 2007-11-24 18:58:33Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 3032 $
|
||||
<td class="normal"> * @version $Revision: 3212 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -157,7 +157,7 @@
|
||||
<td class="covered"> $func = substr($func, ($pos + 1), -1);
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="covered"> $params = Doctrine_Tokenizer::bracketExplode($func, ',', '(', ')');
|
||||
<td class="covered"> $params = $this->_tokenizer->bracketExplode($func, ',', '(', ')');
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal">
|
||||
@ -280,7 +280,7 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="covered"> $tokens = Doctrine_Tokenizer::bracketExplode($having, ' ', '(', ')');
|
||||
<td class="covered"> $tokens = $this->_tokenizer->bracketExplode($having, ' ', '(', ')');
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="covered"> $part = $this->parseAggregateFunction(array_shift($tokens));
|
||||
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: JoinCondition.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: JoinCondition.php 3212 2007-11-24 18:58:33Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 2702 $
|
||||
<td class="normal"> * @version $Revision: 3212 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -124,7 +124,7 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="covered"> $e = Doctrine_Tokenizer::sqlExplode($condition);
|
||||
<td class="covered"> $e = $this->_tokenizer->sqlExplode($condition);
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal">
|
||||
@ -178,7 +178,7 @@
|
||||
<td class="normal"> // trim brackets
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="red"> $trimmed = Doctrine_Tokenizer::bracketTrim($value);
|
||||
<td class="red"> $trimmed = $this->_tokenizer->bracketTrim($value);
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal">
|
||||
@ -208,7 +208,7 @@
|
||||
<td class="normal"> // simple in expression found
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="red"> $e = Doctrine_Tokenizer::sqlExplode($trimmed, ',');
|
||||
<td class="red"> $e = $this->_tokenizer->sqlExplode($trimmed, ',');
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal">
|
||||
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Part.php 3032 2007-10-29 19:50:16Z meus $
|
||||
<td class="normal"> * $Id: Part.php 3212 2007-11-24 18:58:33Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 3032 $
|
||||
<td class="normal"> * @version $Revision: 3212 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -124,54 +124,72 @@
|
||||
<td class="normal"> protected $query;
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal"> protected $_tokenizer;
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal"> * @param Doctrine_Query $query the query object associated with this parser
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> public function __construct($query)
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="covered"> $this->query = $query;
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<tr><td>42</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> * @return Doctrine_Query $query the query object associated with this parser
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> * @param Doctrine_Query $query the query object associated with this parser
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal"> public function getQuery()
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> public function __construct($query, Doctrine_Query_Tokenizer $tokenizer = null)
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="covered"> $this->query = $query;
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="covered"> if ( ! $tokenizer) {
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="covered"> $tokenizer = new Doctrine_Query_Tokenizer();
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="covered"> $this->_tokenizer = $tokenizer;
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="red"> return $this->query;
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> * @return Doctrine_Query $query the query object associated with this parser
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> public function getQuery()
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="red"> return $this->query;
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Set.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: Set.php 3212 2007-11-24 18:58:33Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 2702 $
|
||||
<td class="normal"> * @version $Revision: 3212 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -118,7 +118,7 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="covered"> $terms = Doctrine_Tokenizer::sqlExplode($dql, ' ');
|
||||
<td class="covered"> $terms = $this->_tokenizer->sqlExplode($dql, ' ');
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal">
|
||||
|
1163
tests/coverage/Doctrine_Query_Tokenizer.html
Normal file
1163
tests/coverage/Doctrine_Query_Tokenizer.html
Normal file
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Where.php 3029 2007-10-29 18:04:22Z zYne $
|
||||
<td class="normal"> * $Id: Where.php 3212 2007-11-24 18:58:33Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 3029 $
|
||||
<td class="normal"> * @version $Revision: 3212 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -118,13 +118,13 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="covered"> $where = Doctrine_Tokenizer::bracketTrim(trim($where));
|
||||
<td class="covered"> $where = $this->_tokenizer->bracketTrim(trim($where));
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="covered"> $conn = $this->query->getConnection();
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="covered"> $terms = Doctrine_Tokenizer::sqlExplode($where);
|
||||
<td class="covered"> $terms = $this->_tokenizer->sqlExplode($where);
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal">
|
||||
@ -157,7 +157,7 @@
|
||||
<td class="covered"> if (count($terms) < 3) {
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="covered"> $terms = Doctrine_Tokenizer::sqlExplode($where, array('=', '<', '<>', '>', '!='));
|
||||
<td class="covered"> $terms = $this->_tokenizer->sqlExplode($where, array('=', '<', '<>', '>', '!='));
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="covered"> }
|
||||
@ -286,7 +286,7 @@
|
||||
<td class="normal"> // trim brackets
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="covered"> $trimmed = Doctrine_Tokenizer::bracketTrim($value);
|
||||
<td class="covered"> $trimmed = $this->_tokenizer->bracketTrim($value);
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="normal">
|
||||
@ -325,7 +325,7 @@
|
||||
<td class="normal"> // simple in expression found
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="covered"> $e = Doctrine_Tokenizer::sqlExplode($trimmed, ',');
|
||||
<td class="covered"> $e = $this->_tokenizer->sqlExplode($trimmed, ',');
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal">
|
||||
@ -385,7 +385,7 @@
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="covered"> } elseif (substr($value, 0, 1) == ':' || $value === '?') {
|
||||
<td class="covered"> } else if (substr($value, 0, 1) == ':' || $value === '?') {
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="normal"> // placeholder found
|
||||
@ -505,7 +505,7 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="covered"> $sub = Doctrine_Tokenizer::bracketTrim(substr($where, $pos));
|
||||
<td class="covered"> $sub = $this->_tokenizer->bracketTrim(substr($where, $pos));
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="normal">
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: Association.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: Association.php 3209 2007-11-24 18:11:09Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -106,7 +106,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>33</td>
|
||||
<td class="normal"> * @version $Revision: 2963 $
|
||||
<td class="normal"> * @version $Revision: 3209 $
|
||||
</td></tr>
|
||||
<tr><td>34</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
@ -181,119 +181,125 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="covered"> $component = $this->definition['refTable']->getComponentName();
|
||||
<td class="covered"> $table = $this->definition['refTable'];
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> switch ($context) {
|
||||
<td class="covered"> $component = $this->definition['refTable']->getComponentName();
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="covered"> case "record":
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="covered"> $sub = substr(str_repeat("?, ", $count),0,-2);
|
||||
<td class="normal"> switch ($context) {
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> $dql = 'FROM ' . $this->getTable()->getComponentName();
|
||||
<td class="covered"> case "record":
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="covered"> $dql .= '.' . $component;
|
||||
<td class="covered"> $sub = substr(str_repeat("?, ", $count),0,-2);
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="covered"> $dql .= ' WHERE ' . $this->getTable()->getComponentName()
|
||||
<td class="covered"> $dql = 'FROM ' . $this->getTable()->getComponentName();
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="covered"> . '.' . $component . '.' . $this->definition['local'] . ' IN (' . $sub . ')';
|
||||
<td class="covered"> $dql .= '.' . $component;
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="covered"> break;
|
||||
<td class="covered"> $dql .= ' WHERE ' . $this->getTable()->getComponentName()
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="red"> case "collection":
|
||||
<td class="covered"> . '.' . $component . '.' . $this->definition['local'] . ' IN (' . $sub . ')';
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="red"> $sub = substr(str_repeat("?, ", $count),0,-2);
|
||||
<td class="covered"> break;
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="red"> $dql = 'FROM ' . $component . '.' . $this->getTable()->getComponentName();
|
||||
<td class="red"> case "collection":
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="red"> $dql .= ' WHERE ' . $component . '.' . $this->definition['local'] . ' IN (' . $sub . ')';
|
||||
<td class="red"> $sub = substr(str_repeat("?, ", $count),0,-2);
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="red"> break;
|
||||
<td class="red"> $dql = 'FROM ' . $component . '.' . $this->getTable()->getComponentName();
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="orange"> }
|
||||
<td class="red"> $dql .= ' WHERE ' . $component . '.' . $this->definition['local'] . ' IN (' . $sub . ')';
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal">
|
||||
<td class="red"> break;
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="covered"> return $dql;
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="covered"> return $dql;
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="normal"> /**
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="normal"> * fetchRelatedFor
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="normal"> * fetches a component related to given record
|
||||
<td class="normal"> * fetchRelatedFor
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal"> * @param Doctrine_Record $record
|
||||
<td class="normal"> * fetches a component related to given record
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="normal"> * @return Doctrine_Record|Doctrine_Collection
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @param Doctrine_Record $record
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal"> public function fetchRelatedFor(Doctrine_Record $record)
|
||||
<td class="normal"> * @return Doctrine_Record|Doctrine_Collection
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="covered"> $id = $record->getIncremented();
|
||||
<td class="normal"> public function fetchRelatedFor(Doctrine_Record $record)
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="covered"> if (empty($id) || ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) {
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="covered"> $coll = new Doctrine_Collection($this->getTable());
|
||||
<td class="covered"> $id = $record->getIncremented();
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="covered"> } else {
|
||||
<td class="covered"> if (empty($id) || ! $this->definition['table']->getAttribute(Doctrine::ATTR_LOAD_REFERENCES)) {
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="covered"> $coll = Doctrine_Query::create()->parseQuery($this->getRelationDql(1))->execute(array($id));
|
||||
<td class="covered"> $coll = new Doctrine_Collection($this->getTable());
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal"> }
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="covered"> $coll->setReference($record, $this);
|
||||
<td class="covered"> $coll = Doctrine_Query::create()->query($this->getRelationDql(1), array($id));
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="covered"> return $coll;
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> $coll->setReference($record, $this);
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="covered"> return $coll;
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="covered">}</td></tr>
|
||||
</table></body></html>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -139,7 +139,7 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="red"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal">
|
||||
@ -154,7 +154,7 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="red"> }
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> public function postInsert(Doctrine_Event $event)
|
||||
|
@ -142,543 +142,576 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> protected $_words = array();
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> protected $_condition;
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> protected $_tokenizer;
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> * @param Doctrine_Table $_table the index table
|
||||
<td class="normal"> protected $_condition;
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal"> public function __construct($table)
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * @param Doctrine_Table $_table the index table
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="covered"> if (is_string($table)) {
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="covered"> $table = Doctrine_Manager::table($table);
|
||||
<td class="normal"> public function __construct($table)
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="covered"> } else {
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="covered"> if ( ! $table instanceof Doctrine_Table) {
|
||||
<td class="covered"> if (is_string($table)) {
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="covered"> throw new Doctrine_Search_Exception('Invalid argument type. Expected instance of Doctrine_Table.');
|
||||
<td class="covered"> $table = Doctrine_Manager::table($table);
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> }
|
||||
<td class="covered"> if ( ! $table instanceof Doctrine_Table) {
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> throw new Doctrine_Search_Exception('Invalid argument type. Expected instance of Doctrine_Table.');
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="covered"> $this->_table = $table;
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="covered"> $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position')));
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $this->_tokenizer = new Doctrine_Query_Tokenizer();
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="covered"> $this->_condition = $foreignId . ' %s (SELECT ' . $foreignId . ' FROM ' . $this->_table->getTableName() . ' WHERE ';
|
||||
<td class="covered"> $this->_table = $table;
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="covered"> }
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position')));
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> public function query($text)
|
||||
<td class="covered"> $this->_condition = $foreignId . ' %s (SELECT ' . $foreignId . ' FROM ' . $this->_table->getTableName() . ' WHERE ';
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> {
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="covered"> $text = trim($text);
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="covered"> $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position')));
|
||||
<td class="normal"> public function query($text)
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="covered"> $weighted = false;
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="covered"> if (strpos($text, '^') === false) {
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="covered"> $select = 'SELECT COUNT(keyword) AS relevance, ' . $foreignId;
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="covered"> $from = 'FROM ' . $this->_table->getTableName();
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="normal"> // organize terms according weights
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="covered"> $weighted = true;
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="covered"> $select = 'SELECT SUM(sub_relevance) AS relevance, ' . $foreignId;
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="covered"> $from = 'FROM ' ;
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="covered"> $where = 'WHERE ';
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="covered"> $where .= $this->parseClause($text);
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="covered"> $groupby = 'GROUP BY ' . $foreignId;
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="covered"> $orderby = 'ORDER BY relevance';
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="covered"> $this->_sql = $select . ' ' . $from . ' ' . $where . ' ' . $groupby . ' ' . $orderby;
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="normal"> public function parseClause($originalClause, $recursive = false)
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="covered"> $clause = Doctrine_Tokenizer::bracketTrim($originalClause);
|
||||
<tr><td>75</td>
|
||||
<td class="covered"> $text = trim($text);
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="covered"> $brackets = false;
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<tr><td>76</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="covered"> $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position')));
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="covered"> $weighted = false;
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="covered"> if (strpos($text, '^') === false) {
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="covered"> $select = 'SELECT COUNT(keyword) AS relevance, ' . $foreignId;
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="covered"> $from = 'FROM ' . $this->_table->getTableName();
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> // organize terms according weights
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="covered"> $weighted = true;
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="covered"> $select = 'SELECT SUM(sub_relevance) AS relevance, ' . $foreignId;
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="covered"> $from = 'FROM ' ;
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="covered"> $where = 'WHERE ';
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="covered"> $where .= $this->parseClause($text);
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="covered"> $groupby = 'GROUP BY ' . $foreignId;
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="covered"> $orderby = 'ORDER BY relevance DESC';
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="covered"> $this->_sql = $select . ' ' . $from . ' ' . $where . ' ' . $groupby . ' ' . $orderby;
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="normal"> public function parseClause($originalClause, $recursive = false)
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="covered"> if ($clause !== $originalClause) {
|
||||
<td class="covered"> $clause = $this->_tokenizer->bracketTrim($originalClause);
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="covered"> $brackets = true;
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $brackets = false;
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="covered"> $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position')));
|
||||
<td class="covered"> if ($clause !== $originalClause) {
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $brackets = true;
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="covered"> $terms = Doctrine_Tokenizer::sqlExplode($clause, ' OR ', '(', ')');
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="covered"> $ret = array();
|
||||
<td class="covered"> $foreignId = current(array_diff($this->_table->getColumnNames(), array('keyword', 'field', 'position')));
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="normal">
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="covered"> if (count($terms) > 1) {
|
||||
<td class="covered"> $terms = $this->_tokenizer->sqlExplode($clause, ' OR ', '(', ')');
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="covered"> $leavesOnly = true;
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $ret = array();
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="covered"> foreach ($terms as $k => $term) {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="covered"> if ($this->isExpression($term)) {
|
||||
<td class="covered"> if (count($terms) > 1) {
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="covered"> $ret[$k] = $this->parseClause($term, true);
|
||||
<td class="covered"> $leavesOnly = true;
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="covered"> $leavesOnly = false;
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="covered"> } else {
|
||||
<td class="covered"> foreach ($terms as $k => $term) {
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="covered"> $ret[$k] = $this->parseTerm($term);
|
||||
<td class="covered"> if ($this->isExpression($term)) {
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="normal"> }
|
||||
<td class="covered"> $ret[$k] = $this->parseClause($term, true);
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $leavesOnly = false;
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="covered"> $return = implode(' OR ', $ret);
|
||||
<td class="covered"> $ret[$k] = $this->parseTerm($term);
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="covered"> if ($leavesOnly && $recursive) {
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="covered"> $return = sprintf($this->_condition, 'IN') . $return . ')';
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> $brackets = false;
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="covered"> $return = implode(' OR ', $ret);
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="covered"> } else {
|
||||
<td class="covered"> if ($leavesOnly && $recursive) {
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="covered"> $terms = Doctrine_Tokenizer::sqlExplode($clause, ' ', '(', ')');
|
||||
<td class="covered"> $return = sprintf($this->_condition, 'IN') . $return . ')';
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $brackets = false;
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="covered"> if (count($terms) === 1 && ! $recursive) {
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="covered"> $return = $this->parseTerm($clause);
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="covered"> } else {
|
||||
<td class="covered"> $terms = $this->_tokenizer->sqlExplode($clause, ' ', '(', ')');
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="covered"> foreach ($terms as $k => $term) {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="covered"> $term = trim($term);
|
||||
<td class="covered"> if (count($terms) === 1 && ! $recursive) {
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> $return = $this->parseTerm($clause);
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="covered"> if ($term === 'AND') {
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="covered"> continue;
|
||||
<td class="covered"> foreach ($terms as $k => $term) {
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> $term = trim($term);
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="covered"> if (substr($term, 0, 1) === '-') {
|
||||
<td class="covered"> if ($term === 'AND') {
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="covered"> $operator = 'NOT IN';
|
||||
<td class="covered"> continue;
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="covered"> $term = substr($term, 1);
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="covered"> $operator = 'IN';
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="covered"> if (substr($term, 0, 1) === '-') {
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="covered"> $operator = 'NOT IN';
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="covered"> $term = substr($term, 1);
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="covered"> if ($this->isExpression($term)) {
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="covered"> $ret[$k] = $this->parseClause($term, true);
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="covered"> $ret[$k] = sprintf($this->_condition, $operator) . $this->parseTerm($term) . ')';
|
||||
<tr><td>151</td>
|
||||
<td class="covered"> $operator = 'IN';
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<tr><td>152</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<td class="covered"> if ($this->isExpression($term)) {
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $ret[$k] = $this->parseClause($term, true);
|
||||
</td></tr>
|
||||
<tr><td>156</td>
|
||||
<td class="covered"> $return = implode(' AND ', $ret);
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>157</td>
|
||||
<td class="normal"> }
|
||||
<td class="covered"> $ret[$k] = sprintf($this->_condition, $operator) . $this->parseTerm($term) . ')';
|
||||
</td></tr>
|
||||
<tr><td>158</td>
|
||||
<td class="normal"> }
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>159</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>160</td>
|
||||
<td class="covered"> if ($brackets) {
|
||||
<td class="covered"> $return = implode(' AND ', $ret);
|
||||
</td></tr>
|
||||
<tr><td>161</td>
|
||||
<td class="covered"> return '(' . $return . ')';
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>162</td>
|
||||
<td class="orange"> } else {
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>163</td>
|
||||
<td class="covered"> return $return;
|
||||
</td></tr>
|
||||
<tr><td>164</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>165</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="normal"> public function isExpression($term)
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<td class="covered"> if (strpos($term, '(') !== false) {
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="covered"> return true;
|
||||
</td></tr>
|
||||
<tr><td>170</td>
|
||||
<td class="orange"> } else {
|
||||
</td></tr>
|
||||
<tr><td>171</td>
|
||||
<td class="covered"> $terms = Doctrine_Tokenizer::quoteExplode($term);
|
||||
</td></tr>
|
||||
<tr><td>172</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>173</td>
|
||||
<td class="covered"> return (count($terms) > 1);
|
||||
</td></tr>
|
||||
<tr><td>174</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>175</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>176</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>177</td>
|
||||
<td class="normal"> public function parseTerm($term)
|
||||
<tr><td>164</td>
|
||||
<td class="covered"> if ($brackets) {
|
||||
</td></tr>
|
||||
<tr><td>178</td>
|
||||
<tr><td>165</td>
|
||||
<td class="covered"> return '(' . $return . ')';
|
||||
</td></tr>
|
||||
<tr><td>166</td>
|
||||
<td class="orange"> } else {
|
||||
</td></tr>
|
||||
<tr><td>167</td>
|
||||
<td class="covered"> return $return;
|
||||
</td></tr>
|
||||
<tr><td>168</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>169</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>170</td>
|
||||
<td class="normal"> public function isExpression($term)
|
||||
</td></tr>
|
||||
<tr><td>171</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>172</td>
|
||||
<td class="covered"> if (strpos($term, '(') !== false) {
|
||||
</td></tr>
|
||||
<tr><td>173</td>
|
||||
<td class="covered"> return true;
|
||||
</td></tr>
|
||||
<tr><td>174</td>
|
||||
<td class="orange"> } else {
|
||||
</td></tr>
|
||||
<tr><td>175</td>
|
||||
<td class="covered"> $terms = $this->_tokenizer->quoteExplode($term);
|
||||
</td></tr>
|
||||
<tr><td>176</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>177</td>
|
||||
<td class="covered"> return (count($terms) > 1);
|
||||
</td></tr>
|
||||
<tr><td>178</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>179</td>
|
||||
<td class="covered"> $negation = false;
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>180</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>181</td>
|
||||
<td class="covered"> if (strpos($term, "'") === false) {
|
||||
<td class="normal"> public function parseTerm($term)
|
||||
</td></tr>
|
||||
<tr><td>182</td>
|
||||
<td class="covered"> $where = $this->parseWord($term);
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>183</td>
|
||||
<td class="covered"> } else {
|
||||
<td class="covered"> $negation = false;
|
||||
</td></tr>
|
||||
<tr><td>184</td>
|
||||
<td class="covered"> $term = trim($term, "' ");
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>185</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> if (strpos($term, "'") === false) {
|
||||
</td></tr>
|
||||
<tr><td>186</td>
|
||||
<td class="covered"> $terms = Doctrine_Tokenizer::quoteExplode($term);
|
||||
<td class="covered"> $where = $this->parseWord($term);
|
||||
</td></tr>
|
||||
<tr><td>187</td>
|
||||
<td class="covered"> $where = $this->parseWord($terms[0]);
|
||||
</td></tr>
|
||||
<tr><td>188</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>189</td>
|
||||
<td class="covered"> foreach ($terms as $k => $word) {
|
||||
</td></tr>
|
||||
<tr><td>190</td>
|
||||
<td class="covered"> if ($k === 0) {
|
||||
</td></tr>
|
||||
<tr><td>191</td>
|
||||
<td class="covered"> continue;
|
||||
</td></tr>
|
||||
<tr><td>192</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>193</td>
|
||||
<td class="covered"> $where .= ' AND (position + ' . $k . ') = (SELECT position FROM ' . $this->_table->getTableName() . ' WHERE ' . $this->parseWord($word) . ')';
|
||||
</td></tr>
|
||||
<tr><td>194</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>195</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>196</td>
|
||||
<td class="covered"> return $where;
|
||||
</td></tr>
|
||||
<tr><td>197</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>198</td>
|
||||
<td class="normal"> public function parseWord($word)
|
||||
</td></tr>
|
||||
<tr><td>199</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>200</td>
|
||||
<td class="covered"> if (strpos($word, '?') !== false ||
|
||||
</td></tr>
|
||||
<tr><td>201</td>
|
||||
<td class="covered"> strpos($word, '*') !== false) {
|
||||
</td></tr>
|
||||
<tr><td>202</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>203</td>
|
||||
<td class="covered"> $word = str_replace('*', '%', $word);
|
||||
</td></tr>
|
||||
<tr><td>204</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>205</td>
|
||||
<td class="covered"> $where = 'keyword LIKE ?';
|
||||
</td></tr>
|
||||
<tr><td>206</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>207</td>
|
||||
<td class="covered"> $params = array($word);
|
||||
</td></tr>
|
||||
<tr><td>208</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>209</td>
|
||||
<td class="covered"> $where = 'keyword = ?';
|
||||
<tr><td>188</td>
|
||||
<td class="covered"> $term = trim($term, "' ");
|
||||
</td></tr>
|
||||
<tr><td>210</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>211</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>212</td>
|
||||
<td class="covered"> $this->_params[] = $word;
|
||||
</td></tr>
|
||||
<tr><td>213</td>
|
||||
<tr><td>189</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>214</td>
|
||||
<tr><td>190</td>
|
||||
<td class="covered"> $terms = $this->_tokenizer->quoteExplode($term);
|
||||
</td></tr>
|
||||
<tr><td>191</td>
|
||||
<td class="covered"> $where = $this->parseWord($terms[0]);
|
||||
</td></tr>
|
||||
<tr><td>192</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>193</td>
|
||||
<td class="covered"> foreach ($terms as $k => $word) {
|
||||
</td></tr>
|
||||
<tr><td>194</td>
|
||||
<td class="covered"> if ($k === 0) {
|
||||
</td></tr>
|
||||
<tr><td>195</td>
|
||||
<td class="covered"> continue;
|
||||
</td></tr>
|
||||
<tr><td>196</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>197</td>
|
||||
<td class="covered"> $where .= ' AND (position + ' . $k . ') = (SELECT position FROM ' . $this->_table->getTableName() . ' WHERE ' . $this->parseWord($word) . ')';
|
||||
</td></tr>
|
||||
<tr><td>198</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>199</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>200</td>
|
||||
<td class="covered"> return $where;
|
||||
</td></tr>
|
||||
<tr><td>215</td>
|
||||
<tr><td>201</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>202</td>
|
||||
<td class="normal"> public function parseWord($word)
|
||||
</td></tr>
|
||||
<tr><td>203</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>204</td>
|
||||
<td class="covered"> $this->_words[] = str_replace('*', '', $word);
|
||||
</td></tr>
|
||||
<tr><td>205</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>206</td>
|
||||
<td class="covered"> if (strpos($word, '?') !== false ||
|
||||
</td></tr>
|
||||
<tr><td>207</td>
|
||||
<td class="covered"> strpos($word, '*') !== false) {
|
||||
</td></tr>
|
||||
<tr><td>208</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>209</td>
|
||||
<td class="covered"> $word = str_replace('*', '%', $word);
|
||||
</td></tr>
|
||||
<tr><td>210</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>211</td>
|
||||
<td class="covered"> $where = 'keyword LIKE ?';
|
||||
</td></tr>
|
||||
<tr><td>212</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>213</td>
|
||||
<td class="covered"> $params = array($word);
|
||||
</td></tr>
|
||||
<tr><td>214</td>
|
||||
<td class="covered"> } else {
|
||||
</td></tr>
|
||||
<tr><td>215</td>
|
||||
<td class="covered"> $where = 'keyword = ?';
|
||||
</td></tr>
|
||||
<tr><td>216</td>
|
||||
<td class="normal"> public function getParams()
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>217</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>218</td>
|
||||
<td class="covered"> return $this->_params;
|
||||
<td class="covered"> $this->_params[] = $word;
|
||||
</td></tr>
|
||||
<tr><td>219</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>220</td>
|
||||
<td class="normal"> public function getSql()
|
||||
<td class="covered"> return $where;
|
||||
</td></tr>
|
||||
<tr><td>221</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>222</td>
|
||||
<td class="covered"> return $this->_sql;
|
||||
</td></tr>
|
||||
<tr><td>223</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>222</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>223</td>
|
||||
<td class="normal"> public function getWords()
|
||||
</td></tr>
|
||||
<tr><td>224</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>225</td>
|
||||
<td class="red"> return $this->_words;
|
||||
</td></tr>
|
||||
<tr><td>226</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>227</td>
|
||||
<td class="normal"> public function getParams()
|
||||
</td></tr>
|
||||
<tr><td>228</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>229</td>
|
||||
<td class="covered"> return $this->_params;
|
||||
</td></tr>
|
||||
<tr><td>230</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>231</td>
|
||||
<td class="normal"> public function getSql()
|
||||
</td></tr>
|
||||
<tr><td>232</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>233</td>
|
||||
<td class="covered"> return $this->_sql;
|
||||
</td></tr>
|
||||
<tr><td>234</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>235</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
File diff suppressed because it is too large
Load Diff
@ -271,72 +271,207 @@
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal"> public function getPlugin()
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * addChild
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="covered"> return $this->_plugin;
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal"> * Adds a plugin as a child to this plugin
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="normal"> public function get($name)
|
||||
<td class="normal"> * @param Doctrine_Template $template
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * @return Doctrine_Template. Chainable.
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="red"> throw new Doctrine_Exception("Templates doesn't support accessors.");
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="orange"> }
|
||||
<td class="normal"> public function addChild(Doctrine_Template $template)
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="normal"> public function set($name, $value)
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="normal"> {
|
||||
<td class="covered"> $this->_plugin->addChild($template);
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="red"> throw new Doctrine_Exception("Templates doesn't support accessors.");
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> return $this;
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="normal"> public function setUp()
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="covered"> }
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> * getPlugin
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="normal"> public function setTableDefinition()
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="covered"> }
|
||||
<td class="normal"> public function getPlugin()
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="covered"> return $this->_plugin;
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="normal"> * get
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="normal"> * @param mixed $name
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="normal"> public function get($name)
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="red"> throw new Doctrine_Exception("Templates doesn't support accessors.");
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="normal"> * set
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<td class="normal"> * @param mixed $name
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<td class="normal"> * @param mixed $value
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="normal"> public function set($name, $value)
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="red"> throw new Doctrine_Exception("Templates doesn't support accessors.");
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="normal"> * setUp
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="normal"> public function setUp()
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="normal"> * setTableDefinition
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>150</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>151</td>
|
||||
<td class="normal"> public function setTableDefinition()
|
||||
</td></tr>
|
||||
<tr><td>152</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>153</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>154</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>155</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
@ -112,182 +112,117 @@
|
||||
<td class="normal">{
|
||||
</td></tr>
|
||||
<tr><td>35</td>
|
||||
<td class="normal"> protected $_translation;
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>36</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal"> * __construct
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<tr><td>37</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<tr><td>38</td>
|
||||
<td class="normal"> * @param string $array
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<tr><td>39</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal"> public function __construct(array $options = array())
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> public function __construct(array $options)
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="covered"> $this->_plugin = new Doctrine_I18n($options);
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<tr><td>44</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> * translation
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal"> * sets or retrieves the current translation language
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal"> * @return Doctrine_Record this object
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> public function translation($language = null)
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="red"> $this->_translation = $language;
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="red"> return $this->_translation;
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> * setUp
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> public function setUp()
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<tr><td>51</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="covered"> $this->_plugin->setOption('table', $this->_table);
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<tr><td>52</td>
|
||||
<td class="covered"> $name = $this->_table->getComponentName();
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<tr><td>53</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="covered"> $this->_plugin->buildPluginDefinition($this->_table);
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="covered"> $className = $this->_plugin->getOption('className');
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<tr><td>57</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="covered"> if (strpos($className, '%CLASS%') !== false) {
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="covered"> $this->_plugin->setOption('className', str_replace('%CLASS%', $name, $className));
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="covered"> $className = $this->_plugin->getOption('className');
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="covered"> $this->_plugin->buildDefinition($this->_table);
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<tr><td>58</td>
|
||||
<td class="covered"> $id = $this->_table->getIdentifier();
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<tr><td>59</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="covered"> $this->hasMany($className . ' as Translation', array('local' => $id[0], 'foreign' => $id[0]));
|
||||
<tr><td>60</td>
|
||||
<td class="covered"> $this->hasMany($className . ' as Translation', array('local' => $id, 'foreign' => $id));
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<tr><td>61</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<tr><td>62</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> * getI18n
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<tr><td>67</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> public function getI18n()
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<tr><td>70</td>
|
||||
<td class="red"> return $this->_plugin;
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<tr><td>71</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
314
tests/coverage/Doctrine_Template_Listener_Timestampable.html
Normal file
314
tests/coverage/Doctrine_Template_Listener_Timestampable.html
Normal file
@ -0,0 +1,314 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Coverage for Doctrine_Template_Listener_Timestampable</title>
|
||||
<style type="text/css">
|
||||
.covered{ background: green;}
|
||||
.normal{ background: white;}
|
||||
.red{ background: red;}
|
||||
.orange{ background: #f90;}
|
||||
</style>
|
||||
</head>
|
||||
<body><h1>Coverage for Doctrine_Template_Listener_Timestampable</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>
|
||||
<td class="normal"> * $Id$
|
||||
</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>
|
||||
<td class="normal"> * <http://www.phpdoctrine.com>.
|
||||
</td></tr>
|
||||
<tr><td>20</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>21</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>22</td>
|
||||
<td class="normal">/**
|
||||
</td></tr>
|
||||
<tr><td>23</td>
|
||||
<td class="normal"> * Doctrine_Template_Listener_Timestampable
|
||||
</td></tr>
|
||||
<tr><td>24</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>25</td>
|
||||
<td class="normal"> * @package Doctrine
|
||||
</td></tr>
|
||||
<tr><td>26</td>
|
||||
<td class="normal"> * @subpackage Template
|
||||
</td></tr>
|
||||
<tr><td>27</td>
|
||||
<td class="normal"> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
</td></tr>
|
||||
<tr><td>28</td>
|
||||
<td class="normal"> * @link www.phpdoctrine.com
|
||||
</td></tr>
|
||||
<tr><td>29</td>
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision$
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
</td></tr>
|
||||
<tr><td>32</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>33</td>
|
||||
<td class="covered">class Doctrine_Template_Listener_Timestampable extends Doctrine_Record_Listener
|
||||
</td></tr>
|
||||
<tr><td>34</td>
|
||||
<td class="normal">{
|
||||
</td></tr>
|
||||
<tr><td>35</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>36</td>
|
||||
<td class="normal"> * Array of timestampable options
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal"> * @var string
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> protected $_options = array();
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> * __construct
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> * @param string $options
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> public function __construct(array $options)
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="covered"> $this->_options = $options;
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal"> * preInsert
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal"> * @param object $Doctrine_Event
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> public function preInsert(Doctrine_Event $event)
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="covered"> $createdName = $this->_options['created']['name'];
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> $updatedName = $this->_options['updated']['name'];
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="covered"> $event->getInvoker()->$createdName = $this->getTimestamp('created');
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="covered"> $event->getInvoker()->$updatedName = $this->getTimestamp('updated');
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> * preUpdate
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal"> * @param object $Doctrine_Event
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="normal"> public function preUpdate(Doctrine_Event $event)
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="red"> $updatedName = $this->_options['updated']['name'];
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="red"> $event->getInvoker()->$updatedName = $this->getTimestamp('updated');
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal"> * getTimestamp
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> * Gets the timestamp in the correct format
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="normal"> * @param string $type
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> public function getTimestamp($type)
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="covered"> $options = $this->_options[$type];
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="covered"> if ($options['type'] == 'date') {
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="red"> return date($options['format'], time());
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="covered"> } else if ($options['type'] == 'timestamp') {
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="covered"> return date($options['format'], time());
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="orange"> } else {
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="red"> return time();
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal"> }
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="covered">}</td></tr>
|
||||
</table></body></html>
|
@ -118,102 +118,96 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="covered"> $this->_plugin = new Doctrine_Search($options);
|
||||
<td class="covered"> $this->_plugin = new Doctrine_Search($options);
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<tr><td>39</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> public function getPlugin()
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<tr><td>41</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<tr><td>42</td>
|
||||
<td class="covered"> return $this->_plugin;
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<tr><td>43</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<tr><td>44</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> public function setUp()
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<tr><td>47</td>
|
||||
<td class="covered"> $id = $this->_table->getIdentifier();
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<tr><td>48</td>
|
||||
<td class="covered"> $name = $this->_table->getComponentName();
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<tr><td>49</td>
|
||||
<td class="covered"> $className = $this->_plugin->getOption('className');
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<tr><td>50</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<tr><td>51</td>
|
||||
<td class="covered"> if (strpos($className, '%CLASS%') !== false) {
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<tr><td>52</td>
|
||||
<td class="covered"> $this->_plugin->setOption('className', str_replace('%CLASS%', $name, $className));
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<tr><td>53</td>
|
||||
<td class="covered"> $className = $this->_plugin->getOption('className');
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<tr><td>54</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<tr><td>55</td>
|
||||
<td class="covered"> $this->_plugin->setOption('resource', $this->_table);
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<tr><td>56</td>
|
||||
<td class="covered"> $this->_plugin->buildDefinition();
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="covered"> $this->hasMany($className, array('local' => $id, 'foreign' => $id));
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="covered"> $this->hasMany($className, array('local' => $id, 'foreign' => $id));
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> $this->addListener(new Doctrine_Search_Listener($this->_plugin));
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<tr><td>61</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<tr><td>62</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> public function batchUpdateIndex($limit = null, $offset = null)
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<tr><td>65</td>
|
||||
<td class="covered"> $this->_plugin->batchUpdateIndex($limit, $offset);
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<tr><td>66</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<tr><td>67</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
222
tests/coverage/Doctrine_Template_Sluggable.html
Normal file
222
tests/coverage/Doctrine_Template_Sluggable.html
Normal file
@ -0,0 +1,222 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Coverage for Doctrine_Template_Sluggable</title>
|
||||
<style type="text/css">
|
||||
.covered{ background: green;}
|
||||
.normal{ background: white;}
|
||||
.red{ background: red;}
|
||||
.orange{ background: #f90;}
|
||||
</style>
|
||||
</head>
|
||||
<body><h1>Coverage for Doctrine_Template_Sluggable</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>
|
||||
<td class="normal"> * $Id$
|
||||
</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>
|
||||
<td class="normal"> * <http://www.phpdoctrine.com>.
|
||||
</td></tr>
|
||||
<tr><td>20</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>21</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>22</td>
|
||||
<td class="normal">/**
|
||||
</td></tr>
|
||||
<tr><td>23</td>
|
||||
<td class="normal"> * Doctrine_Template_Sluggable
|
||||
</td></tr>
|
||||
<tr><td>24</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>25</td>
|
||||
<td class="normal"> * Easily create a slug for each record based on a specified set of fields
|
||||
</td></tr>
|
||||
<tr><td>26</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>27</td>
|
||||
<td class="normal"> * @package Doctrine
|
||||
</td></tr>
|
||||
<tr><td>28</td>
|
||||
<td class="normal"> * @subpackage Template
|
||||
</td></tr>
|
||||
<tr><td>29</td>
|
||||
<td class="normal"> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @link www.phpdoctrine.com
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>32</td>
|
||||
<td class="normal"> * @version $Revision$
|
||||
</td></tr>
|
||||
<tr><td>33</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
</td></tr>
|
||||
<tr><td>34</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>35</td>
|
||||
<td class="covered">class Doctrine_Template_Sluggable extends Doctrine_Template
|
||||
</td></tr>
|
||||
<tr><td>36</td>
|
||||
<td class="normal">{
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal"> * Array of timestampable options
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> * @var string
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal"> protected $_options = array('name' => 'slug',
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> 'type' => 'clob',
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> 'length' => null,
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> 'options' => array(),
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> 'fields' => array());
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> * __construct
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal"> * @param string $array
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal"> public function __construct(array $options)
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="covered"> $this->_options = array_merge($options, $this->_options);
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> * setTableDefinition
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> public function setTableDefinition()
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="red"> $this->hasColumn($this->_options['name'], $this->_options['type'], $this->_options['length'], $this->_options['options']);
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="red"> $this->addListener(new Doctrine_Template_Listener_Sluggable($this->_options));
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
233
tests/coverage/Doctrine_Template_Timestampable.html
Normal file
233
tests/coverage/Doctrine_Template_Timestampable.html
Normal file
@ -0,0 +1,233 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Coverage for Doctrine_Template_Timestampable</title>
|
||||
<style type="text/css">
|
||||
.covered{ background: green;}
|
||||
.normal{ background: white;}
|
||||
.red{ background: red;}
|
||||
.orange{ background: #f90;}
|
||||
</style>
|
||||
</head>
|
||||
<body><h1>Coverage for Doctrine_Template_Timestampable</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>
|
||||
<td class="normal"> * $Id$
|
||||
</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>
|
||||
<td class="normal"> * <http://www.phpdoctrine.com>.
|
||||
</td></tr>
|
||||
<tr><td>20</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>21</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>22</td>
|
||||
<td class="normal">/**
|
||||
</td></tr>
|
||||
<tr><td>23</td>
|
||||
<td class="normal"> * Doctrine_Template_Timestampable
|
||||
</td></tr>
|
||||
<tr><td>24</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>25</td>
|
||||
<td class="normal"> * Easily add created and updated at timestamps to your doctrine records
|
||||
</td></tr>
|
||||
<tr><td>26</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>27</td>
|
||||
<td class="normal"> * @package Doctrine
|
||||
</td></tr>
|
||||
<tr><td>28</td>
|
||||
<td class="normal"> * @subpackage Template
|
||||
</td></tr>
|
||||
<tr><td>29</td>
|
||||
<td class="normal"> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @link www.phpdoctrine.com
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>32</td>
|
||||
<td class="normal"> * @version $Revision$
|
||||
</td></tr>
|
||||
<tr><td>33</td>
|
||||
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
</td></tr>
|
||||
<tr><td>34</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>35</td>
|
||||
<td class="covered">class Doctrine_Template_Timestampable extends Doctrine_Template
|
||||
</td></tr>
|
||||
<tr><td>36</td>
|
||||
<td class="normal">{
|
||||
</td></tr>
|
||||
<tr><td>37</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>38</td>
|
||||
<td class="normal"> * Array of timestampable options
|
||||
</td></tr>
|
||||
<tr><td>39</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>40</td>
|
||||
<td class="normal"> * @var string
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="normal"> protected $_options = array('created' => array('name' => 'created_at',
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> 'type' => 'timestamp',
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal"> 'format' => 'Y-m-d H:i:s',
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> 'options' => array()),
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> 'updated' => array('name' => 'updated_at',
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> 'type' => 'timestamp',
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> 'format' => 'Y-m-d H:i:s',
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> 'options' => array()));
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="normal"> * __construct
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal"> * @param string $array
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> public function __construct(array $options)
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="covered"> $this->_options = array_merge($options, $this->_options);
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="normal"> * setTableDefinition
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> * @return void
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="normal"> public function setTableDefinition()
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="covered"> $this->hasColumn($this->_options['created']['name'], $this->_options['created']['type'], null, $this->_options['created']['name']);
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="covered"> $this->hasColumn($this->_options['updated']['name'], $this->_options['updated']['type'], null, $this->_options['updated']['name']);
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="covered"> $this->addListener(new Doctrine_Template_Listener_Timestampable($this->_options));
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="covered">}</td></tr>
|
||||
</table></body></html>
|
@ -130,33 +130,39 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>41</td>
|
||||
<td class="covered"> $this->_plugin->setOption('table', $this->_table);
|
||||
<td class="covered"> $this->_plugin->buildPluginDefinition($this->_table);
|
||||
</td></tr>
|
||||
<tr><td>42</td>
|
||||
<td class="covered"> $this->_plugin->buildDefinition($this->_table);
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="covered"> $this->hasColumn('version', 'integer', 8);
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="covered"> $this->addListener(new Doctrine_AuditLog_Listener($this->_plugin));
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $this->addListener(new Doctrine_AuditLog_Listener($this->_plugin));
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> public function getAuditLog()
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> public function getAuditLog()
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="covered"> return $this->_plugin;
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="orange"> }
|
||||
<td class="covered"> return $this->_plugin;
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: NestedSet.php 3087 2007-11-08 18:50:20Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: NestedSet.php 3144 2007-11-13 15:52:45Z romanb $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -97,7 +97,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>30</td>
|
||||
<td class="normal"> * @version $Revision: 3087 $
|
||||
<td class="normal"> * @version $Revision: 3144 $
|
||||
</td></tr>
|
||||
<tr><td>31</td>
|
||||
<td class="normal"> * @author Joe Simms <joe.simms@websites4.com>
|
||||
@ -964,7 +964,7 @@
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>319</td>
|
||||
<td class="red"> $this->_baseQuery = null;
|
||||
<td class="red"> $this->_baseQuery = $this->_createBaseQuery();
|
||||
</td></tr>
|
||||
<tr><td>320</td>
|
||||
<td class="red"> }
|
||||
|
@ -16,7 +16,7 @@
|
||||
<td class="normal">/*
|
||||
</td></tr>
|
||||
<tr><td>3</td>
|
||||
<td class="normal"> * $Id: ErrorStack.php 2963 2007-10-21 06:23:59Z Jonathan.Wage $
|
||||
<td class="normal"> * $Id: ErrorStack.php 3157 2007-11-14 21:06:30Z zYne $
|
||||
</td></tr>
|
||||
<tr><td>4</td>
|
||||
<td class="normal"> *
|
||||
@ -103,7 +103,7 @@
|
||||
<td class="normal"> * @since 1.0
|
||||
</td></tr>
|
||||
<tr><td>32</td>
|
||||
<td class="normal"> * @version $Revision: 2963 $
|
||||
<td class="normal"> * @version $Revision: 3157 $
|
||||
</td></tr>
|
||||
<tr><td>33</td>
|
||||
<td class="normal"> */
|
||||
@ -136,305 +136,324 @@
|
||||
<td class="normal"> protected $errors = array();
|
||||
</td></tr>
|
||||
<tr><td>43</td>
|
||||
<td class="normal"> protected $classname = "";
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>44</td>
|
||||
<td class="normal">
|
||||
<td class="normal"> protected $classname = "";
|
||||
</td></tr>
|
||||
<tr><td>45</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>46</td>
|
||||
<td class="normal"> * Constructor
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>47</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * Constructor
|
||||
</td></tr>
|
||||
<tr><td>48</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>49</td>
|
||||
<td class="normal"> public function __construct($classname = "")
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>50</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> public function __construct($classname = "")
|
||||
</td></tr>
|
||||
<tr><td>51</td>
|
||||
<td class="covered"> $this->classname = $classname;
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>52</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $this->classname = $classname;
|
||||
</td></tr>
|
||||
<tr><td>53</td>
|
||||
<td class="normal">
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>54</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>55</td>
|
||||
<td class="normal"> * Adds an error to the stack.
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>56</td>
|
||||
<td class="normal"> *
|
||||
<td class="normal"> * Adds an error to the stack.
|
||||
</td></tr>
|
||||
<tr><td>57</td>
|
||||
<td class="normal"> * @param string $invalidFieldName
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>58</td>
|
||||
<td class="normal"> * @param string $errorType
|
||||
<td class="normal"> * @param string $invalidFieldName
|
||||
</td></tr>
|
||||
<tr><td>59</td>
|
||||
<td class="normal"> */
|
||||
<td class="normal"> * @param string $errorType
|
||||
</td></tr>
|
||||
<tr><td>60</td>
|
||||
<td class="normal"> public function add($invalidFieldName, $errorCode = 'general')
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>61</td>
|
||||
<td class="normal"> {
|
||||
<td class="normal"> public function add($invalidFieldName, $errorCode = 'general')
|
||||
</td></tr>
|
||||
<tr><td>62</td>
|
||||
<td class="covered"> $this->errors[$invalidFieldName][] = $errorCode;
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>63</td>
|
||||
<td class="covered"> }
|
||||
<td class="covered"> $this->errors[$invalidFieldName][] = $errorCode;
|
||||
</td></tr>
|
||||
<tr><td>64</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>65</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> * Removes all existing errors for the specified field from the stack.
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> * @param string $fieldName
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> public function remove($fieldName)
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="red"> if (isset($this->errors[$fieldName])) {
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="red"> unset($this->errors[$fieldName]);
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="normal"> * Enter description here...
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="normal"> * @param unknown_type $name
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="normal"> * @return unknown
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="normal"> public function get($fieldName)
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="covered"> return isset($this->errors[$fieldName]) ? $this->errors[$fieldName] : null;
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> * Enter description here...
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="normal"> * @param unknown_type $name
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="normal"> public function set($fieldName, $errorCode)
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="red"> $this->add($fieldName, $errorCode);
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal"> * Enter description here...
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="normal"> * @return unknown
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="normal"> public function contains($fieldName)
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="red"> return array_key_exists($fieldName, $this->errors);
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal"> * Removes all errors from the stack.
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="normal"> public function clear()
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="covered"> $this->errors = array();
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<tr><td>65</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>66</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>67</td>
|
||||
<td class="normal"> * Removes all existing errors for the specified field from the stack.
|
||||
</td></tr>
|
||||
<tr><td>68</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>69</td>
|
||||
<td class="normal"> * @param string $fieldName
|
||||
</td></tr>
|
||||
<tr><td>70</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>71</td>
|
||||
<td class="normal"> public function remove($fieldName)
|
||||
</td></tr>
|
||||
<tr><td>72</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>73</td>
|
||||
<td class="red"> if (isset($this->errors[$fieldName])) {
|
||||
</td></tr>
|
||||
<tr><td>74</td>
|
||||
<td class="red"> unset($this->errors[$fieldName]);
|
||||
</td></tr>
|
||||
<tr><td>75</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>76</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>77</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>78</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>79</td>
|
||||
<td class="normal"> * Enter description here...
|
||||
</td></tr>
|
||||
<tr><td>80</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>81</td>
|
||||
<td class="normal"> * @param unknown_type $name
|
||||
</td></tr>
|
||||
<tr><td>82</td>
|
||||
<td class="normal"> * @return unknown
|
||||
</td></tr>
|
||||
<tr><td>83</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>84</td>
|
||||
<td class="normal"> public function get($fieldName)
|
||||
</td></tr>
|
||||
<tr><td>85</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>86</td>
|
||||
<td class="covered"> return isset($this->errors[$fieldName]) ? $this->errors[$fieldName] : null;
|
||||
</td></tr>
|
||||
<tr><td>87</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>88</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>89</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>90</td>
|
||||
<td class="normal"> * Enter description here...
|
||||
</td></tr>
|
||||
<tr><td>91</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>92</td>
|
||||
<td class="normal"> * @param unknown_type $name
|
||||
</td></tr>
|
||||
<tr><td>93</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>94</td>
|
||||
<td class="normal"> public function set($fieldName, $errorCode)
|
||||
</td></tr>
|
||||
<tr><td>95</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>96</td>
|
||||
<td class="red"> $this->add($fieldName, $errorCode);
|
||||
</td></tr>
|
||||
<tr><td>97</td>
|
||||
<td class="red"> }
|
||||
</td></tr>
|
||||
<tr><td>98</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>99</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>100</td>
|
||||
<td class="normal"> * Enter description here...
|
||||
</td></tr>
|
||||
<tr><td>101</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>102</td>
|
||||
<td class="normal"> * @return unknown
|
||||
</td></tr>
|
||||
<tr><td>103</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>104</td>
|
||||
<td class="normal"> public function contains($fieldName)
|
||||
</td></tr>
|
||||
<tr><td>105</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>106</td>
|
||||
<td class="red"> return array_key_exists($fieldName, $this->errors);
|
||||
</td></tr>
|
||||
<tr><td>107</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>108</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>109</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>110</td>
|
||||
<td class="normal"> * Removes all errors from the stack.
|
||||
</td></tr>
|
||||
<tr><td>111</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>112</td>
|
||||
<td class="normal"> public function clear()
|
||||
</td></tr>
|
||||
<tr><td>113</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>114</td>
|
||||
<td class="covered"> $this->errors = array();
|
||||
</td></tr>
|
||||
<tr><td>115</td>
|
||||
<td class="covered"> }
|
||||
</td></tr>
|
||||
<tr><td>116</td>
|
||||
<td class="normal"> /**
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>117</td>
|
||||
<td class="normal"> * Enter description here...
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>118</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>119</td>
|
||||
<td class="normal"> * @return unknown
|
||||
</td></tr>
|
||||
<tr><td>120</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>121</td>
|
||||
<td class="normal"> public function getIterator()
|
||||
</td></tr>
|
||||
<tr><td>122</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>123</td>
|
||||
<td class="red"> return new ArrayIterator($this->errors);
|
||||
</td></tr>
|
||||
<tr><td>124</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>125</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>126</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>127</td>
|
||||
<td class="normal"> * Enter description here...
|
||||
</td></tr>
|
||||
<tr><td>128</td>
|
||||
<tr><td>119</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>129</td>
|
||||
<tr><td>120</td>
|
||||
<td class="normal"> * @return unknown
|
||||
</td></tr>
|
||||
<tr><td>130</td>
|
||||
<tr><td>121</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="normal"> public function count()
|
||||
<tr><td>122</td>
|
||||
<td class="normal"> public function getIterator()
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<tr><td>123</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="covered"> return count($this->errors);
|
||||
<tr><td>124</td>
|
||||
<td class="red"> return new ArrayIterator($this->errors);
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<tr><td>125</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<tr><td>126</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="normal"> /**
|
||||
<tr><td>127</td>
|
||||
<td class="normal"> public function toArray()
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="normal"> * Get the classname where the errors occured
|
||||
<tr><td>128</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="normal"> *
|
||||
<tr><td>129</td>
|
||||
<td class="red"> return $this->errors;
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="normal"> public function getClassname(){
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="red"> return $this->classname;
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<tr><td>130</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>131</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>132</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>133</td>
|
||||
<td class="normal"> * Enter description here...
|
||||
</td></tr>
|
||||
<tr><td>134</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>135</td>
|
||||
<td class="normal"> * @return unknown
|
||||
</td></tr>
|
||||
<tr><td>136</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>137</td>
|
||||
<td class="normal"> public function count()
|
||||
</td></tr>
|
||||
<tr><td>138</td>
|
||||
<td class="normal"> {
|
||||
</td></tr>
|
||||
<tr><td>139</td>
|
||||
<td class="covered"> return count($this->errors);
|
||||
</td></tr>
|
||||
<tr><td>140</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>141</td>
|
||||
<td class="normal">
|
||||
</td></tr>
|
||||
<tr><td>142</td>
|
||||
<td class="normal"> /**
|
||||
</td></tr>
|
||||
<tr><td>143</td>
|
||||
<td class="covered">}</td></tr>
|
||||
<td class="normal"> * Get the classname where the errors occured
|
||||
</td></tr>
|
||||
<tr><td>144</td>
|
||||
<td class="normal"> *
|
||||
</td></tr>
|
||||
<tr><td>145</td>
|
||||
<td class="normal"> */
|
||||
</td></tr>
|
||||
<tr><td>146</td>
|
||||
<td class="normal"> public function getClassname(){
|
||||
</td></tr>
|
||||
<tr><td>147</td>
|
||||
<td class="red"> return $this->classname;
|
||||
</td></tr>
|
||||
<tr><td>148</td>
|
||||
<td class="orange"> }
|
||||
</td></tr>
|
||||
<tr><td>149</td>
|
||||
<td class="normal">}
|
||||
</td></tr>
|
||||
</table></body></html>
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user