2007-10-14 01:45:08 +04:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Coverage for Doctrine_Plugin</title>
|
|
|
|
<style type="text/css">
|
|
|
|
.covered{ background: green;}
|
|
|
|
.normal{ background: white;}
|
|
|
|
.red{ background: red;}
|
|
|
|
.orange{ background: #f90;}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body><h1>Coverage for Doctrine_Plugin</h1><p><a href="index.php">Back to coverage report</a></p><table>
|
|
|
|
<tr><td>1</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"><?php
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>2</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">/*
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>3</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * $Id$
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>4</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>5</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>6</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>7</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>8</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>9</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>10</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>11</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>12</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>13</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>14</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>15</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>16</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>17</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * This software consists of voluntary contributions made by many individuals
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>18</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * and is licensed under the LGPL. For more information, see
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>19</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * <http://www.phpdoctrine.org>.
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>20</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>21</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>22</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">/**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>23</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * Doctrine_Plugin
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>24</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>25</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>26</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @package Doctrine
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>27</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @subpackage Plugin
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>28</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>29</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @version $Revision$
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>30</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @link www.phpdoctrine.org
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>31</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @since 1.0
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>32</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>33</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">abstract class Doctrine_Plugin
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>34</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered">{
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>35</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>36</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @var array $_options an array of plugin specific options
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>37</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>38</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> protected $_options = array('generateFiles' => false,
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>39</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> 'identifier' => false,
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>40</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> 'generateFiles' => false,
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>41</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> 'table' => false,
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>42</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> 'pluginTable' => false,
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>43</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> 'children' => array(),);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>44</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>45</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>46</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * __get
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>47</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * an alias for getOption
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>48</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>49</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param string $option
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>50</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>51</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function __get($option)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>52</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>53</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> if (isset($this->_options[$option])) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>54</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> return $this->_options[$option];
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>55</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>56</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> return null;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>57</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>58</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>59</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>60</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * __isset
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>61</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>62</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param string $option
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>63</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>64</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function __isset($option)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>65</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>66</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> return isset($this->_options[$option]);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>67</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>68</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>69</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>70</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * returns the value of an option
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>71</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>72</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param $option the name of the option to retrieve
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>73</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @return mixed the value of the option
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>74</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>75</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function getOption($name)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>76</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>77</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> if ( ! isset($this->_options[$name])) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>78</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> throw new Doctrine_Plugin_Exception('Unknown option ' . $name);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>79</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>80</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>81</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> return $this->_options[$name];
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>82</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>83</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>84</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>85</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * sets given value to an option
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>86</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>87</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param $option the name of the option to be changed
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>88</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param $value the value of the option
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>89</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @return Doctrine_Plugin this object
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>90</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>91</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function setOption($name, $value)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>92</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>93</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $this->_options[$name] = $value;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>94</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>95</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> return $this;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>96</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>97</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>98</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function addChild(Doctrine_Template $template)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>99</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>100</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $this->_options['children'][] = $template;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>101</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>102</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>103</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>104</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * returns all options and their associated values
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>105</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>106</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @return array all options as an associative array
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>107</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>108</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function getOptions()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>109</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>110</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> return $this->_options;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>111</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>112</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>113</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function buildPluginDefinition(Doctrine_Table $table)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>114</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>115</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $this->_options['table'] = $table;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>116</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>117</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $this->_options['className'] = str_replace('%CLASS%',
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>118</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $this->_options['table']->getComponentName(),
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>119</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $this->_options['className']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>120</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>121</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> // check that class doesn't exist (otherwise we cannot create it)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>122</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> if (class_exists($this->_options['className'])) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>123</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> return false;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>124</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>125</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>126</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $this->buildDefinition();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>127</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>128</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>129</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> abstract public function buildDefinition();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>130</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>131</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function buildForeignKeys(Doctrine_Table $table)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>132</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>133</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $id = $table->getIdentifier();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>134</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>135</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $fk = array();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>136</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> foreach ((array) $id as $column) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>137</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $def = $table->getDefinitionOf($column);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>138</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>139</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> unset($def['autoincrement']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>140</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> unset($def['sequence']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>141</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> unset($def['unique']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>142</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>143</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $fk[$column] = $def;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>144</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>145</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>146</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> return $fk;
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>147</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>148</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>149</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function generateChildDefinitions()
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>150</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>151</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> foreach ($this->_options['children'] as $child) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>152</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $this->_options['pluginTable']->addTemplate(get_class($child), $child);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>153</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>154</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $child->setTable($this->_options['pluginTable']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>155</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>156</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $child->setUp();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>157</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>158</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> }
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>159</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>160</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> /**
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>161</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * generates foreign keys for the plugin table based on the owner table
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>162</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>163</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * the foreign keys generated by this method can be used for
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>164</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * setting the relations between the owner and the plugin classes
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>165</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>166</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param Doctrine_Table $table the table object that owns the plugin
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>167</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @return array an array of foreign key definitions
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>168</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>169</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function generateForeignKeys(Doctrine_Table $table)
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>170</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>171</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $fk = array();
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>172</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>173</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> foreach ((array) $table->getIdentifier() as $column) {
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>174</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $def = $table->getDefinitionOf($column);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>175</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>176</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> unset($def['autoincrement']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>177</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> unset($def['sequence']);
|
2007-10-14 01:45:08 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>178</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> unset($def['primary']);
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>179</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>180</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $col = $column;
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>181</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>182</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $def['primary'] = true;
|
2007-10-21 20:12:20 +04:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>183</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $fk[$col] = $def;
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>184</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> }
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>185</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> return $fk;
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>186</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>187</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>188</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> /**
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>189</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * generates a relation array to given table
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>190</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>191</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * this method can be used for generating the relation from the plugin
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>192</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * table to the owner table
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>193</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>194</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param Doctrine_Table $table the table object to construct the relation to
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>195</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param array $foreignKeys an array of foreign keys
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>196</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @return array the generated relation array
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>197</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>198</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function generateRelation(Doctrine_Table $table, array $foreignKeys)
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>199</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>200</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $local = (count($foreignKeys) > 1) ? array_keys($foreignKeys) : key($foreignKeys);
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>201</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>202</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $relation = array($table->getComponentName() =>
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>203</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> array('local' => $local,
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>204</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> 'foreign' => $table->getIdentifier(),
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>205</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> 'onDelete' => 'CASCADE',
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>206</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> 'onUpdate' => 'CASCADE'));
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>207</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>208</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> return $relation;
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>209</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="orange"> }
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>210</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>211</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> /**
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>212</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * generates the class definition for plugin class
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>213</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> *
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>214</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param array $options plugin class options, keys representing the option names
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>215</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * and values as option values
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>216</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param array $columns the plugin class columns, keys representing the column names
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>217</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * and values as column definitions
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>218</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @param array $relations the bound relations of the plugin class
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>219</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> * @return void
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>220</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> */
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>221</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> public function generateClass($options, $columns, $relations)
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>222</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> {
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>223</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $builder = new Doctrine_Import_Builder();
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>224</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>225</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> if ($this->_options['generateFiles']) {
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>226</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> if (isset($this->_options['generatePath']) && $this->_options['generatePath']) {
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>227</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> $builder->setTargetPath($this->_options['generatePath']);
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>228</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>229</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> $builder->buildRecord($options, $columns, $relations);
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>230</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> } else {
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>231</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<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.');
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>232</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> }
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>233</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="red"> } else {
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>234</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> $def = $builder->buildDefinition($options, $columns, $relations);
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>235</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>236</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> eval($def);
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>237</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal"> }
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>238</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="covered"> }
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
|
|
|
<tr><td>239</td>
|
2008-02-22 21:11:35 +03:00
|
|
|
<td class="normal">}
|
2007-11-25 23:32:49 +03:00
|
|
|
</td></tr>
|
2007-10-14 01:45:08 +04:00
|
|
|
</table></body></html>
|