Changeset 19666
- Timestamp:
- 06/29/09 11:00:00 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/csDoctrineActAsAttachablePlugin/branches/1.3/lib/csDoctrineActAsAttachableRouting.class.php
- Property svn:keywords set to Id
r19642 r19666 10 10 11 11 /** 12 * routing class for csDoctrineActAsAttachable plugin 12 13 * 13 14 * @package symfony 14 15 * @subpackage plugin 15 16 * @author Gordon Franke <gfranke@savedcite.com> 16 * @version SVN: $Id : sfGuardExtraRouting.class.php 18403 2009-05-18 15:05:27Z gimler$17 * @version SVN: $Id$ 17 18 */ 18 19 class csDoctrineActAsAttachableRouting plugins/csDoctrineActAsAttachablePlugin/branches/1.3/lib/template/Attachable.php
- Property svn:keywords set to Id
r19642 r19666 1 1 <?php 2 3 /** 4 * template for attachable behavior 5 * 6 * @package symfony 7 * @subpackage plugin 8 * @author Brent Shaffer 9 * @version SVN: $Id$ 10 */ 2 11 class Doctrine_Template_Attachable extends Doctrine_Template 3 12 { 4 13 protected $_options = array('types' => array(), 5 14 'attachableModels' => array()); 6 15 7 16 /** 8 17 * Constructor for Attachable Template 9 18 * 10 * @param array $options 19 * @param array $options template options 20 * 11 21 * @return void 12 * @author Brent Shaffer13 22 */ 14 23 public function __construct(array $options = array()) … … 17 26 } 18 27 28 /** 29 * @see Doctrine_Template 30 */ 19 31 public function setTableDefinition() 20 32 { … … 23 35 24 36 /** 37 * get the doctrine query that is used for fetching attachments 25 38 * 26 39 * @return Doctrine_Query … … 36 49 } 37 50 51 /** 52 * get all attachments 53 * 54 * @return Doctrine_Collection|false 55 */ 38 56 public function getAttachments() 39 57 { … … 43 61 } 44 62 63 /** 64 * add attachments 65 * 66 * @param array $attachments attachments to add 67 * 68 * @return void 69 * 70 * @see addAttachment 71 */ 45 72 public function setAttachments($attachments) 46 73 { … … 51 78 } 52 79 80 /** 81 * check if the record has a attachment 82 * 83 * @return boolean 84 */ 53 85 public function hasAttachments() 54 86 { … … 56 88 } 57 89 90 /** 91 * check if the record has a attachment of specific type 92 * 93 * @return boolean 94 */ 58 95 public function hasAttachmentsOfType($type) 59 96 { … … 61 98 } 62 99 63 public function addAttachment($attachment) 100 /** 101 * add attachment to record and save attachment into db 102 * 103 * @param Attachment $attachment the attachment record 104 * 105 * @return void 106 */ 107 public function addAttachment(Attachment $attachment) 64 108 { 65 109 $object = $this->getInvoker(); … … 73 117 $attachment->save(); 74 118 } 75 119 120 /** 121 * get record attachments of specific type 122 * 123 * @param string $type the attachemnt type to fetch 124 * 125 * @return Doctrine_Collection 126 */ 76 127 public function getAttachmentsByType($type) 77 128 { … … 90 141 } 91 142 143 /** 144 * get all supported attachment types 145 * 146 * @return array 147 * 148 * @see getAttachableConfig() 149 */ 92 150 public function getSupportedAttachmentTypes() 93 151 { … … 95 153 } 96 154 155 /** 156 * get complete config or specific value 157 * 158 * @param string $index 159 * 160 * @return mixed 161 */ 97 162 public function getAttachableConfig($index = null) 98 163 { … … 104 169 } 105 170 171 /** 172 * get all attachments of type video 173 * 174 * @return Doctrine_Collection 175 * 176 * @see getAttachmentsByType() 177 */ 106 178 public function getVideoAttachments() 107 179 { … … 109 181 } 110 182 183 /** 184 * get all attachments of type image 185 * 186 * @return Doctrine_Collection 187 * 188 * @see getAttachmentsByType() 189 */ 111 190 public function getImageAttachments() 112 191 { … … 114 193 } 115 194 195 /** 196 * get all attachments of type document 197 * 198 * @return Doctrine_Collection 199 * 200 * @see getAttachmentsByType() 201 */ 116 202 public function getDocumentAttachments() 117 203 { … … 119 205 } 120 206 207 /** 208 * get all attachments of type other 209 * 210 * @return Doctrine_Collection 211 * 212 * @see getAttachmentsByType() 213 */ 121 214 public function getOtherAttachments() 122 215 { … … 124 217 } 125 218 219 /** 220 * get all attachments of type model 221 * 222 * @return Doctrine_Collection 223 * 224 * @see getAttachmentsByType() 225 */ 126 226 public function getModelAttachments() 127 227 {