| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
@copyright |
|---|
| 6 |
@author will@flourishlib.com |
|---|
| 7 |
@license http://flourishlib.com/license |
|---|
| 8 |
|
|---|
| 9 |
@package |
|---|
| 10 |
@link http://flourishlib.com/fORM |
|---|
| 11 |
|
|---|
| 12 |
@version |
|---|
| 13 |
@changes |
|---|
| 14 |
@changes |
|---|
| 15 |
@changes |
|---|
| 16 |
@changes |
|---|
| 17 |
@changes |
|---|
| 18 |
@changes |
|---|
| 19 |
@changes |
|---|
| 20 |
@changes |
|---|
| 21 |
@changes |
|---|
| 22 |
@changes |
|---|
| 23 |
@changes |
|---|
| 24 |
@changes |
|---|
| 25 |
@changes |
|---|
| 26 |
@changes |
|---|
| 27 |
@changes |
|---|
| 28 |
@changes |
|---|
| 29 |
@changes |
|---|
| 30 |
@changes |
|---|
| 31 |
@changes |
|---|
| 32 |
@changes |
|---|
| 33 |
@changes |
|---|
| 34 |
|
|---|
| 35 |
class fORM |
|---|
| 36 |
{ |
|---|
| 37 |
|
|---|
| 38 |
const callHookCallbacks = 'fORM::callHookCallbacks'; |
|---|
| 39 |
const callInspectCallbacks = 'fORM::callInspectCallbacks'; |
|---|
| 40 |
const callReflectCallbacks = 'fORM::callReflectCallbacks'; |
|---|
| 41 |
const checkHookCallback = 'fORM::checkHookCallback'; |
|---|
| 42 |
const classize = 'fORM::classize'; |
|---|
| 43 |
const defineActiveRecordClass = 'fORM::defineActiveRecordClass'; |
|---|
| 44 |
const enableSchemaCaching = 'fORM::enableSchemaCaching'; |
|---|
| 45 |
const getActiveRecordMethod = 'fORM::getActiveRecordMethod'; |
|---|
| 46 |
const getClass = 'fORM::getClass'; |
|---|
| 47 |
const getColumnName = 'fORM::getColumnName'; |
|---|
| 48 |
const getDatabaseName = 'fORM::getDatabaseName'; |
|---|
| 49 |
const getRecordName = 'fORM::getRecordName'; |
|---|
| 50 |
const getRecordSetMethod = 'fORM::getRecordSetMethod'; |
|---|
| 51 |
const isClassMappedToTable = 'fORM::isClassMappedToTable'; |
|---|
| 52 |
const mapClassToDatabase = 'fORM::mapClassToDatabase'; |
|---|
| 53 |
const mapClassToTable = 'fORM::mapClassToTable'; |
|---|
| 54 |
const objectify = 'fORM::objectify'; |
|---|
| 55 |
const overrideColumnName = 'fORM::overrideColumnName'; |
|---|
| 56 |
const overrideRecordName = 'fORM::overrideRecordName'; |
|---|
| 57 |
const parseMethod = 'fORM::parseMethod'; |
|---|
| 58 |
const registerActiveRecordMethod = 'fORM::registerActiveRecordMethod'; |
|---|
| 59 |
const registerHookCallback = 'fORM::registerHookCallback'; |
|---|
| 60 |
const registerInspectCallback = 'fORM::registerInspectCallback'; |
|---|
| 61 |
const registerObjectifyCallback = 'fORM::registerObjectifyCallback'; |
|---|
| 62 |
const registerRecordSetMethod = 'fORM::registerRecordSetMethod'; |
|---|
| 63 |
const registerReflectCallback = 'fORM::registerReflectCallback'; |
|---|
| 64 |
const registerReplicateCallback = 'fORM::registerReplicateCallback'; |
|---|
| 65 |
const registerScalarizeCallback = 'fORM::registerScalarizeCallback'; |
|---|
| 66 |
const replicate = 'fORM::replicate'; |
|---|
| 67 |
const reset = 'fORM::reset'; |
|---|
| 68 |
const scalarize = 'fORM::scalarize'; |
|---|
| 69 |
const tablize = 'fORM::tablize'; |
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
@var |
|---|
| 76 |
|
|---|
| 77 |
static private $active_record_method_callbacks = array(); |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
@var |
|---|
| 83 |
|
|---|
| 84 |
static private $cache = array( |
|---|
| 85 |
'parseMethod' => array(), |
|---|
| 86 |
'getActiveRecordMethod' => array(), |
|---|
| 87 |
'objectify' => array() |
|---|
| 88 |
); |
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
@var |
|---|
| 94 |
|
|---|
| 95 |
static private $class_database_map = array( |
|---|
| 96 |
'fActiveRecord' => 'default' |
|---|
| 97 |
); |
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
@var |
|---|
| 103 |
|
|---|
| 104 |
static private $class_table_map = array(); |
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
@var |
|---|
| 110 |
|
|---|
| 111 |
static private $column_names = array(); |
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
@var |
|---|
| 117 |
|
|---|
| 118 |
static private $hook_callbacks = array(); |
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
@var |
|---|
| 124 |
|
|---|
| 125 |
static private $inspect_callbacks = array(); |
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
@var |
|---|
| 131 |
|
|---|
| 132 |
static private $objectify_callbacks = array(); |
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
@var |
|---|
| 138 |
|
|---|
| 139 |
static private $record_names = array( |
|---|
| 140 |
'fActiveRecord' => 'Active Record' |
|---|
| 141 |
); |
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
@var |
|---|
| 147 |
|
|---|
| 148 |
static private $record_set_method_callbacks = array(); |
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
@var |
|---|
| 154 |
|
|---|
| 155 |
static private $reflect_callbacks = array(); |
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
@var |
|---|
| 161 |
|
|---|
| 162 |
static private $replicate_callbacks = array(); |
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
@var |
|---|
| 168 |
|
|---|
| 169 |
static private $scalarize_callbacks = array(); |
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
@internal |
|---|
| 176 |
|
|---|
| 177 |
@param |
|---|
| 178 |
@param |
|---|
| 179 |
@param |
|---|
| 180 |
@param |
|---|
| 181 |
@param |
|---|
| 182 |
@param |
|---|
| 183 |
@param |
|---|
| 184 |
@return |
|---|
| 185 |
|
|---|
| 186 |
static public function callHookCallbacks($object, $hook, &$values, &$old_values, &$related_records, &$cache, &$parameter=NULL) |
|---|
| 187 |
{ |
|---|
| 188 |
$class = get_class($object); |
|---|
| 189 |
|
|---|
| 190 |
if (empty(self::$hook_callbacks[$class][$hook]) && empty(self::$hook_callbacks['*'][$hook])) { |
|---|
| 191 |
return; |
|---|
| 192 |
} |
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
$callbacks = array(); |
|---|
| 196 |
|
|---|
| 197 |
if (isset(self::$hook_callbacks[$class][$hook])) { |
|---|
| 198 |
$callbacks = array_merge($callbacks, self::$hook_callbacks[$class][$hook]); |
|---|
| 199 |
} |
|---|
| 200 |
|
|---|
| 201 |
if (isset(self::$hook_callbacks['*'][$hook])) { |
|---|
| 202 |
$callbacks = array_merge($callbacks, self::$hook_callbacks['*'][$hook]); |
|---|
| 203 |
} |
|---|
| 204 |
|
|---|
| 205 |
foreach ($callbacks as $callback) { |
|---|
| 206 |
call_user_func_array( |
|---|
| 207 |
$callback, |
|---|
| 208 |
|
|---|
| 209 |
array( |
|---|
| 210 |
$object, |
|---|
| 211 |
&$values, |
|---|
| 212 |
&$old_values, |
|---|
| 213 |
&$related_records, |
|---|
| 214 |
&$cache, |
|---|
| 215 |
&$parameter |
|---|
| 216 |
) |
|---|
| 217 |
); |
|---|
| 218 |
} |
|---|
| 219 |
} |
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 |
@internal |
|---|
| 226 |
|
|---|
| 227 |
@param |
|---|
| 228 |
@param |
|---|
| 229 |
@param |
|---|
| 230 |
@return |
|---|
| 231 |
|
|---|
| 232 |
static public function callInspectCallbacks($class, $column, &$metadata) |
|---|
| 233 |
{ |
|---|
| 234 |
if (!isset(self::$inspect_callbacks[$class][$column])) { |
|---|
| 235 |
return; |
|---|
| 236 |
} |
|---|
| 237 |
|
|---|
| 238 |
foreach (self::$inspect_callbacks[$class][$column] as $callback) { |
|---|
| 239 |
|
|---|
| 240 |
$parameters = array( |
|---|
| 241 |
$class, |
|---|
| 242 |
$column, |
|---|
| 243 |
&$metadata |
|---|
| 244 |
); |
|---|
| 245 |
call_user_func_array($callback, $parameters); |
|---|
| 246 |
} |
|---|
| 247 |
} |
|---|
| 248 |
|
|---|
| 249 |
|
|---|
| 250 |
|
|---|
| 251 |
|
|---|
| 252 |
|
|---|
| 253 |
@internal |
|---|
| 254 |
|
|---|
| 255 |
@param |
|---|
| 256 |
@param |
|---|
| 257 |
@param |
|---|
| 258 |
@return |
|---|
| 259 |
|
|---|
| 260 |
static public function callReflectCallbacks($class, &$signatures, $include_doc_comments) |
|---|
| 261 |
{ |
|---|
| 262 |
if (!isset(self::$reflect_callbacks[$class]) && !isset(self::$reflect_callbacks['*'])) { |
|---|
| 263 |
return; |
|---|
| 264 |
} |
|---|
| 265 |
|
|---|
| 266 |
if (!empty(self::$reflect_callbacks['*'])) { |
|---|
| 267 |
foreach (self::$reflect_callbacks['*'] as $callback) { |
|---|
| 268 |
|
|---|
| 269 |
$parameters = array( |
|---|
| 270 |
$class, |
|---|
| 271 |
&$signatures, |
|---|
| 272 |
$include_doc_comments |
|---|
| 273 |
); |
|---|
| 274 |
call_user_func_array($callback, $parameters); |
|---|
| 275 |
} |
|---|
| 276 |
} |
|---|
| 277 |
|
|---|
| 278 |
if (!empty(self::$reflect_callbacks[$class])) { |
|---|
| 279 |
foreach (self::$reflect_callbacks[$class] as $callback) { |
|---|
| 280 |
|
|---|
| 281 |
$parameters = array( |
|---|
| 282 |
$class, |
|---|
| 283 |
&$signatures, |
|---|
| 284 |
$include_doc_comments |
|---|
| 285 |
); |
|---|
| 286 |
call_user_func_array($callback, $parameters); |
|---|
| 287 |
} |
|---|
| 288 |
} |
|---|
| 289 |
} |
|---|
| 290 |
|
|---|
| 291 |
|
|---|
| 292 |
|
|---|
| 293 |
|
|---|
| 294 |
|
|---|
| 295 |
@internal |
|---|
| 296 |
|
|---|
| 297 |
@param |
|---|
| 298 |
@param |
|---|
| 299 |
@param |
|---|
| 300 |
@return |
|---|
| 301 |
|
|---|
| 302 |
static public function checkHookCallback($class, $hook, $callback=NULL) |
|---|
| 303 |
{ |
|---|
| 304 |
if (empty(self::$hook_callbacks[$class][$hook]) && empty(self::$hook_callbacks['*'][$hook])) { |
|---|
| 305 |
return FALSE; |
|---|
| 306 |
} |
|---|
| 307 |
|
|---|
| 308 |
if (!$callback) { |
|---|
| 309 |
return TRUE; |
|---|
| 310 |
} |
|---|
| 311 |
|
|---|
| 312 |
if (is_string($callback) && strpos($callback, '::') !== FALSE) { |
|---|
| 313 |
$callback = explode('::', $callback); |
|---|
| 314 |
} |
|---|
| 315 |
|
|---|
| 316 |
if (!empty(self::$hook_callbacks[$class][$hook]) && in_array($callback, self::$hook_callbacks[$class][$hook])) { |
|---|
| 317 |
return TRUE; |
|---|
| 318 |
} |
|---|
| 319 |
|
|---|
| 320 |
if (!empty(self::$hook_callbacks['*'][$hook]) && in_array($callback, self::$hook_callbacks['*'][$hook])) { |
|---|
| 321 |
return TRUE; |
|---|
| 322 |
} |
|---|
| 323 |
|
|---|
| 324 |
return FALSE; |
|---|
| 325 |
} |
|---|
| 326 |
|
|---|
| 327 |
|
|---|
| 328 |
|
|---|
| 329 |
|
|---|
| 330 |
|
|---|
| 331 |
@param |
|---|
| 332 |
@return |
|---|
| 333 |
|
|---|
| 334 |
static public function classize($table) |
|---|
| 335 |
{ |
|---|
| 336 |
if (!$class = array_search($table, self::$class_table_map)) { |
|---|
| 337 |
$class = fGrammar::camelize(fGrammar::singularize($table), TRUE); |
|---|
| 338 |
self::$class_table_map[$class] = $table; |
|---|
| 339 |
} |
|---|
| 340 |
|
|---|
| 341 |
return $class; |
|---|
| 342 |
} |
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
|
|---|
| 346 |
|
|---|
| 347 |
|
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 |
|
|---|
| 353 |
@param |
|---|
| 354 |
@return |
|---|
| 355 |
|
|---|
| 356 |
static public function defineActiveRecordClass($class) |
|---|
| 357 |
{ |
|---|
| 358 |
if (class_exists($class, FALSE)) { |
|---|
| 359 |
return; |
|---|
| 360 |
} |
|---|
| 361 |
$schema = fORMSchema::retrieve(); |
|---|
| 362 |
$tables = $schema->getTables(); |
|---|
| 363 |
$table = self::tablize($class); |
|---|
| 364 |
if (in_array($table, $tables)) { |
|---|
| 365 |
eval('class ' . $class . ' extends fActiveRecord { };'); |
|---|
| 366 |
return; |
|---|
| 367 |
} |
|---|
| 368 |
|
|---|
| 369 |
throw new fProgrammerException( |
|---|
| 370 |
'The class specified, %s, does not correspond to a database table', |
|---|
| 371 |
$class |
|---|
| 372 |
); |
|---|
| 373 |
} |
|---|
| 374 |
|
|---|
| 375 |
|
|---|
| 376 |
|
|---|
| 377 |
|
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 |
|
|---|
| 381 |
|
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 |
|
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 |
@param |
|---|
| 388 |
@param |
|---|
| 389 |
@param |
|---|
| 390 |
@return |
|---|
| 391 |
|
|---|
| 392 |
static public function enableSchemaCaching($cache, $database_name='default', $key_token=NULL) |
|---|
| 393 |
{ |
|---|
| 394 |
if ($key_token === NULL) { |
|---|
| 395 |
$key_token = $_SERVER['DOCUMENT_ROOT']; |
|---|
| 396 |
} |
|---|
| 397 |
$token = 'fORM::' . $database_name . '::' . $key_token . '::'; |
|---|
| 398 |
|
|---|
| 399 |
$db = fORMDatabase::retrieve('name:' . $database_name); |
|---|
| 400 |
$db->enableCaching($cache, $token); |
|---|
| 401 |
fException::registerCallback($db->clearCache, 'fUnexpectedException'); |
|---|
| 402 |
|
|---|
| 403 |
$sql_translation = $db->getSQLTranslation(); |
|---|
| 404 |
$sql_translation->enableCaching($cache, $token); |
|---|
| 405 |
|
|---|
| 406 |
$schema = fORMSchema::retrieve('name:' . $database_name); |
|---|
| 407 |
$schema->enableCaching($cache, $token); |
|---|
| 408 |
fException::registerCallback($schema->clearCache, 'fUnexpectedException'); |
|---|
| 409 |
} |
|---|
| 410 |
|
|---|
| 411 |
|
|---|
| 412 |
|
|---|
| 413 |
|
|---|
| 414 |
|
|---|
| 415 |
|
|---|
| 416 |
|
|---|
| 417 |
|
|---|
| 418 |
|
|---|
| 419 |
|
|---|
| 420 |
|
|---|
| 421 |
@internal |
|---|
| 422 |
|
|---|
| 423 |
@param |
|---|
| 424 |
@param |
|---|
| 425 |
@return |
|---|
| 426 |
|
|---|
| 427 |
static public function getActiveRecordMethod($class, $method) |
|---|
| 428 |
{ |
|---|
| 429 |
|
|---|
| 430 |
|
|---|
| 431 |
|
|---|
| 432 |
if (isset(self::$cache['getActiveRecordMethod'][$class . '::' . $method])) { |
|---|
| 433 |
return (!$method = self::$cache['getActiveRecordMethod'][$class . '::' . $method]) ? NULL : $method; |
|---|
| 434 |
} |
|---|
| 435 |
|
|---|
| 436 |
$callback = NULL; |
|---|
| 437 |
|
|---|
| 438 |
if (isset(self::$active_record_method_callbacks[$class][$method])) { |
|---|
| 439 |
$callback = self::$active_record_method_callbacks[$class][$method]; |
|---|
| 440 |
|
|---|
| 441 |
} elseif (isset(self::$active_record_method_callbacks['*'][$method])) { |
|---|
| 442 |
$callback = self::$active_record_method_callbacks['*'][$method]; |
|---|
| 443 |
|
|---|
| 444 |
} elseif (preg_match('#[A-Z0-9]#', $method)) { |
|---|
| 445 |
list($action, $subject) = self::parseMethod($method); |
|---|
| 446 |
if (isset(self::$active_record_method_callbacks[$class][$action . '*'])) { |
|---|
| 447 |
$callback = self::$active_record_method_callbacks[$class][$action . '*']; |
|---|
| 448 |
} elseif (isset(self::$active_record_method_callbacks['*'][$action . '*'])) { |
|---|
| 449 |
$callback = self::$active_record_method_callbacks['*'][$action . '*']; |
|---|
| 450 |
} |
|---|
| 451 |
} |
|---|
| 452 |
|
|---|
| 453 |
self::$cache['getActiveRecordMethod'][$class . '::' . $method] = ($callback === NULL) ? FALSE : $callback; |
|---|
| 454 |
return $callback; |
|---|
| 455 |
} |
|---|
| 456 |
|
|---|
| 457 |
|
|---|
| 458 |
|
|---|
| 459 |
|
|---|
| 460 |
|
|---|
| 461 |
@internal |
|---|
| 462 |
|
|---|
| 463 |
@param |
|---|
| 464 |
@return |
|---|
| 465 |
|
|---|
| 466 |
static public function getClass($class) |
|---|
| 467 |
{ |
|---|
| 468 |
if (is_object($class)) { return get_class($class); } |
|---|
| 469 |
return $class; |
|---|
| 470 |
} |
|---|
| 471 |
|
|---|
| 472 |
|
|---|
| 473 |
|
|---|
| 474 |
|
|---|
| 475 |
|
|---|
| 476 |
|
|---|
| 477 |
|
|---|
| 478 |
|
|---|
| 479 |
@internal |
|---|
| 480 |
|
|---|
| 481 |
@param |
|---|
| 482 |
@param |
|---|
| 483 |
@return |
|---|
| 484 |
|
|---|
| 485 |
static public function getColumnName($class, $column) |
|---|
| 486 |
{ |
|---|
| 487 |
if (!isset(self::$column_names[$class])) { |
|---|
| 488 |
self::$column_names[$class] = array(); |
|---|
| 489 |
} |
|---|
| 490 |
|
|---|
| 491 |
if (!isset(self::$column_names[$class][$column])) { |
|---|
| 492 |
self::$column_names[$class][$column] = fGrammar::humanize($column); |
|---|
| 493 |
} |
|---|
| 494 |
|
|---|
| 495 |
return self::$column_names[$class][$column]; |
|---|
| 496 |
} |
|---|
| 497 |
|
|---|
| 498 |
|
|---|
| 499 |
|
|---|
| 500 |
|
|---|
| 501 |
|
|---|
| 502 |
@internal |
|---|
| 503 |
|
|---|
| 504 |
@param |
|---|
| 505 |
@return |
|---|
| 506 |
|
|---|
| 507 |
static public function getDatabaseName($class) |
|---|
| 508 |
{ |
|---|
| 509 |
if (!isset(self::$class_database_map[$class])) { |
|---|
| 510 |
$class = 'fActiveRecord'; |
|---|
| 511 |
} |
|---|
| 512 |
|
|---|
| 513 |
return self::$class_database_map[$class]; |
|---|
| 514 |
} |
|---|
| 515 |
|
|---|
| 516 |
|
|---|
| 517 |
|
|---|
| 518 |
|
|---|
| 519 |
|
|---|
| 520 |
|
|---|
| 521 |
|
|---|
| 522 |
|
|---|
| 523 |
@internal |
|---|
| 524 |
|
|---|
| 525 |
@param |
|---|
| 526 |
@return |
|---|
| 527 |
|
|---|
| 528 |
static public function getRecordName($class) |
|---|
| 529 |
{ |
|---|
| 530 |
if (!isset(self::$record_names[$class])) { |
|---|
| 531 |
self::$record_names[$class] = fGrammar::humanize($class); |
|---|
| 532 |
} |
|---|
| 533 |
|
|---|
| 534 |
return self::$record_names[$class]; |
|---|
| 535 |
} |
|---|
| 536 |
|
|---|
| 537 |
|
|---|
| 538 |
|
|---|
| 539 |
|
|---|
| 540 |
|
|---|
| 541 |
|
|---|
| 542 |
|
|---|
| 543 |
|
|---|
| 544 |
|
|---|
| 545 |
|
|---|
| 546 |
|
|---|
| 547 |
@internal |
|---|
| 548 |
|
|---|
| 549 |
@param |
|---|
| 550 |
@return |
|---|
| 551 |
|
|---|
| 552 |
static public function getRecordSetMethod($method) |
|---|
| 553 |
{ |
|---|
| 554 |
if (isset(self::$record_set_method_callbacks[$method])) { |
|---|
| 555 |
return self::$record_set_method_callbacks[$method]; |
|---|
| 556 |
} |
|---|
| 557 |
|
|---|
| 558 |
if (preg_match('#[A-Z0-9]#', $method)) { |
|---|
| 559 |
list($action, $subject) = self::parseMethod($method); |
|---|
| 560 |
if (isset(self::$record_set_method_callbacks[$action . '*'])) { |
|---|
| 561 |
return self::$record_set_method_callbacks[$action . '*']; |
|---|
| 562 |
} |
|---|
| 563 |
} |
|---|
| 564 |
|
|---|
| 565 |
return NULL; |
|---|
| 566 |
} |
|---|
| 567 |
|
|---|
| 568 |
|
|---|
| 569 |
|
|---|
| 570 |
|
|---|
| 571 |
|
|---|
| 572 |
@internal |
|---|
| 573 |
|
|---|
| 574 |
@param |
|---|
| 575 |
@return |
|---|
| 576 |
|
|---|
| 577 |
static public function isClassMappedToTable($class) |
|---|
| 578 |
{ |
|---|
| 579 |
$class = self::getClass($class); |
|---|
| 580 |
|
|---|
| 581 |
return isset(self::$class_table_map[$class]); |
|---|
| 582 |
} |
|---|
| 583 |
|
|---|
| 584 |
|
|---|
| 585 |
|
|---|
| 586 |
|
|---|
| 587 |
|
|---|
| 588 |
|
|---|
| 589 |
|
|---|
| 590 |
|
|---|
| 591 |
@param |
|---|
| 592 |
@param |
|---|
| 593 |
@return |
|---|
| 594 |
|
|---|
| 595 |
static public function mapClassToDatabase($class, $database_name) |
|---|
| 596 |
{ |
|---|
| 597 |
$class = fORM::getClass($class); |
|---|
| 598 |
|
|---|
| 599 |
self::$class_database_map[$class] = $database_name; |
|---|
| 600 |
} |
|---|
| 601 |
|
|---|
| 602 |
|
|---|
| 603 |
|
|---|
| 604 |
|
|---|
| 605 |
|
|---|
| 606 |
|
|---|
| 607 |
|
|---|
| 608 |
|
|---|
| 609 |
|
|---|
| 610 |
|
|---|
| 611 |
@param |
|---|
| 612 |
@param |
|---|
| 613 |
@return |
|---|
| 614 |
|
|---|
| 615 |
static public function mapClassToTable($class, $table) |
|---|
| 616 |
{ |
|---|
| 617 |
$class = self::getClass($class); |
|---|
| 618 |
|
|---|
| 619 |
self::$class_table_map[$class] = $table; |
|---|
| 620 |
} |
|---|
| 621 |
|
|---|
| 622 |
|
|---|
| 623 |
|
|---|
| 624 |
|
|---|
| 625 |
|
|---|
| 626 |
@internal |
|---|
| 627 |
|
|---|
| 628 |
@param |
|---|
| 629 |
@param |
|---|
| 630 |
@param |
|---|
| 631 |
@return |
|---|
| 632 |
|
|---|
| 633 |
static public function objectify($class, $column, $value) |
|---|
| 634 |
{ |
|---|
| 635 |
|
|---|
| 636 |
|
|---|
| 637 |
if (isset(self::$cache['objectify'][$class . '::' . $column])) { |
|---|
| 638 |
return $value; |
|---|
| 639 |
} |
|---|
| 640 |
|
|---|
| 641 |
if (!empty(self::$objectify_callbacks[$class][$column])) { |
|---|
| 642 |
return call_user_func(self::$objectify_callbacks[$class][$column], $class, $column, $value); |
|---|
| 643 |
} |
|---|
| 644 |
|
|---|
| 645 |
$table = self::tablize($class); |
|---|
| 646 |
$schema = fORMSchema::retrieve($class); |
|---|
| 647 |
|
|---|
| 648 |
|
|---|
| 649 |
$column_type = $schema->getColumnInfo($table, $column, 'type'); |
|---|
| 650 |
|
|---|
| 651 |
if (in_array($column_type, array('date', 'time', 'timestamp'))) { |
|---|
| 652 |
|
|---|
| 653 |
if ($value === NULL) { |
|---|
| 654 |
return $value; |
|---|
| 655 |
} |
|---|
| 656 |
|
|---|
| 657 |
try { |
|---|
| 658 |
|
|---|
| 659 |
|
|---|
| 660 |
switch ($column_type) { |
|---|
| 661 |
case 'date': $value = new fDate($value); break; |
|---|
| 662 |
case 'time': $value = new fTime($value); break; |
|---|
| 663 |
case 'timestamp': $value = new fTimestamp($value); break; |
|---|
| 664 |
} |
|---|
| 665 |
|
|---|
| 666 |
} catch (fValidationException $e) { |
|---|
| 667 |
|
|---|
| 668 |
} |
|---|
| 669 |
|
|---|
| 670 |
} else { |
|---|
| 671 |
self::$cache['objectify'][$class . '::' . $column] = TRUE; |
|---|
| 672 |
} |
|---|
| 673 |
|
|---|
| 674 |
return $value; |
|---|
| 675 |
} |
|---|
| 676 |
|
|---|
| 677 |
|
|---|
| 678 |
|
|---|
| 679 |
|
|---|
| 680 |
|
|---|
| 681 |
|
|---|
| 682 |
|
|---|
| 683 |
|
|---|
| 684 |
@param |
|---|
| 685 |
@param |
|---|
| 686 |
@param |
|---|
| 687 |
@return |
|---|
| 688 |
|
|---|
| 689 |
static public function overrideColumnName($class, $column, $column_name) |
|---|
| 690 |
{ |
|---|
| 691 |
$class = self::getClass($class); |
|---|
| 692 |
|
|---|
| 693 |
if (!isset(self::$column_names[$class])) { |
|---|
| 694 |
self::$column_names[$class] = array(); |
|---|
| 695 |
} |
|---|
| 696 |
|
|---|
| 697 |
self::$column_names[$class][$column] = $column_name; |
|---|
| 698 |
} |
|---|
| 699 |
|
|---|
| 700 |
|
|---|
| 701 |
|
|---|
| 702 |
|
|---|
| 703 |
|
|---|
| 704 |
|
|---|
| 705 |
|
|---|
| 706 |
|
|---|
| 707 |
@param |
|---|
| 708 |
@param |
|---|
| 709 |
@return |
|---|
| 710 |
|
|---|
| 711 |
static public function overrideRecordName($class, $record_name) |
|---|
| 712 |
{ |
|---|
| 713 |
$class = self::getClass($class); |
|---|
| 714 |
self::$record_names[$class] = $record_name; |
|---|
| 715 |
} |
|---|
| 716 |
|
|---|
| 717 |
|
|---|
| 718 |
|
|---|
| 719 |
|
|---|
| 720 |
|
|---|
| 721 |
@internal |
|---|
| 722 |
|
|---|
| 723 |
@param |
|---|
| 724 |
@return |
|---|
| 725 |
|
|---|
| 726 |
static public function parseMethod($method) |
|---|
| 727 |
{ |
|---|
| 728 |
if (isset(self::$cache['parseMethod'][$method])) { |
|---|
| 729 |
return self::$cache['parseMethod'][$method]; |
|---|
| 730 |
} |
|---|
| 731 |
|
|---|
| 732 |
if (!preg_match('#^([a-z]+)(.*)$#D', $method, $matches)) { |
|---|
| 733 |
throw new fProgrammerException( |
|---|
| 734 |
'Invalid method, %s(), called', |
|---|
| 735 |
$method |
|---|
| 736 |
); |
|---|
| 737 |
} |
|---|
| 738 |
self::$cache['parseMethod'][$method] = array($matches[1], fGrammar::underscorize($matches[2])); |
|---|
| 739 |
return self::$cache['parseMethod'][$method]; |
|---|
| 740 |
} |
|---|
| 741 |
|
|---|
| 742 |
|
|---|
| 743 |
|
|---|
| 744 |
|
|---|
| 745 |
|
|---|
| 746 |
|
|---|
| 747 |
|
|---|
| 748 |
|
|---|
| 749 |
|
|---|
| 750 |
|
|---|
| 751 |
|
|---|
| 752 |
|
|---|
| 753 |
|
|---|
| 754 |
|
|---|
| 755 |
|
|---|
| 756 |
@param |
|---|
| 757 |
@param |
|---|
| 758 |
@param |
|---|
| 759 |
@return |
|---|
| 760 |
|
|---|
| 761 |
static public function registerActiveRecordMethod($class, $method, $callback) |
|---|
| 762 |
{ |
|---|
| 763 |
$class = self::getClass($class); |
|---|
| 764 |
|
|---|
| 765 |
if (!isset(self::$active_record_method_callbacks[$class])) { |
|---|
| 766 |
self::$active_record_method_callbacks[$class] = array(); |
|---|
| 767 |
} |
|---|
| 768 |
|
|---|
| 769 |
if (is_string($callback) && strpos($callback, '::') !== FALSE) { |
|---|
| 770 |
$callback = explode('::', $callback); |
|---|
| 771 |
} |
|---|
| 772 |
|
|---|
| 773 |
self::$active_record_method_callbacks[$class][$method] = $callback; |
|---|
| 774 |
|
|---|
| 775 |
self::$cache['getActiveRecordMethod'] = array(); |
|---|
| 776 |
} |
|---|
| 777 |
|
|---|
| 778 |
|
|---|
| 779 |
|
|---|
| 780 |
|
|---|
| 781 |
|
|---|
| 782 |
|
|---|
| 783 |
|
|---|
| 784 |
|
|---|
| 785 |
|
|---|
| 786 |
|
|---|
| 787 |
|
|---|
| 788 |
|
|---|
| 789 |
|
|---|
| 790 |
|
|---|
| 791 |
|
|---|
| 792 |
|
|---|
| 793 |
|
|---|
| 794 |
|
|---|
| 795 |
|
|---|
| 796 |
|
|---|
| 797 |
|
|---|
| 798 |
|
|---|
| 799 |
|
|---|
| 800 |
|
|---|
| 801 |
|
|---|
| 802 |
|
|---|
| 803 |
|
|---|
| 804 |
|
|---|
| 805 |
|
|---|
| 806 |
|
|---|
| 807 |
|
|---|
| 808 |
|
|---|
| 809 |
|
|---|
| 810 |
|
|---|
| 811 |
|
|---|
| 812 |
|
|---|
| 813 |
|
|---|
| 814 |
|
|---|
| 815 |
|
|---|
| 816 |
|
|---|
| 817 |
@param |
|---|
| 818 |
@param |
|---|
| 819 |
@param |
|---|
| 820 |
@return |
|---|
| 821 |
|
|---|
| 822 |
static public function registerHookCallback($class, $hook, $callback) |
|---|
| 823 |
{ |
|---|
| 824 |
$class = self::getClass($class); |
|---|
| 825 |
|
|---|
| 826 |
static $valid_hooks = array( |
|---|
| 827 |
'post::__construct()', |
|---|
| 828 |
'pre::delete()', |
|---|
| 829 |
'post-begin::delete()', |
|---|
| 830 |
'pre-commit::delete()', |
|---|
| 831 |
'post-commit::delete()', |
|---|
| 832 |
'post-rollback::delete()', |
|---|
| 833 |
'post::delete()', |
|---|
| 834 |
'post::loadFromIdentityMap()', |
|---|
| 835 |
'post::loadFromResult()', |
|---|
| 836 |
'pre::populate()', |
|---|
| 837 |
'post::populate()', |
|---|
| 838 |
'pre::store()', |
|---|
| 839 |
'post-begin::store()', |
|---|
| 840 |
'post-validate::store()', |
|---|
| 841 |
'pre-commit::store()', |
|---|
| 842 |
'post-commit::store()', |
|---|
| 843 |
'post-rollback::store()', |
|---|
| 844 |
'post::store()', |
|---|
| 845 |
'pre::validate()', |
|---|
| 846 |
'post::validate()' |
|---|
| 847 |
); |
|---|
| 848 |
|
|---|
| 849 |
if (!in_array($hook, $valid_hooks)) { |
|---|
| 850 |
throw new fProgrammerException( |
|---|
| 851 |
'The hook specified, %1$s, should be one of: %2$s.', |
|---|
| 852 |
$hook, |
|---|
| 853 |
join(', ', $valid_hooks) |
|---|
| 854 |
); |
|---|
| 855 |
} |
|---|
| 856 |
|
|---|
| 857 |
if (!isset(self::$hook_callbacks[$class])) { |
|---|
| 858 |
self::$hook_callbacks[$class] = array(); |
|---|
| 859 |
} |
|---|
| 860 |
|
|---|
| 861 |
if (!isset(self::$hook_callbacks[$class][$hook])) { |
|---|
| 862 |
self::$hook_callbacks[$class][$hook] = array(); |
|---|
| 863 |
} |
|---|
| 864 |
|
|---|
| 865 |
if (is_string($callback) && strpos($callback, '::') !== FALSE) { |
|---|
| 866 |
$callback = explode('::', $callback); |
|---|
| 867 |
} |
|---|
| 868 |
|
|---|
| 869 |
self::$hook_callbacks[$class][$hook][] = $callback; |
|---|
| 870 |
} |
|---|
| 871 |
|
|---|
| 872 |
|
|---|
| 873 |
|
|---|
| 874 |
|
|---|
| 875 |
|
|---|
| 876 |
@param |
|---|
| 877 |
@param |
|---|
| 878 |
@param |
|---|
| 879 |
@return |
|---|
| 880 |
|
|---|
| 881 |
static public function registerInspectCallback($class, $column, $callback) |
|---|
| 882 |
{ |
|---|
| 883 |
$class = self::getClass($class); |
|---|
| 884 |
|
|---|
| 885 |
if (!isset(self::$inspect_callbacks[$class])) { |
|---|
| 886 |
self::$inspect_callbacks[$class] = array(); |
|---|
| 887 |
} |
|---|
| 888 |
if (!isset(self::$inspect_callbacks[$class][$column])) { |
|---|
| 889 |
self::$inspect_callbacks[$class][$column] = array(); |
|---|
| 890 |
} |
|---|
| 891 |
|
|---|
| 892 |
if (is_string($callback) && strpos($callback, '::') !== FALSE) { |
|---|
| 893 |
$callback = explode('::', $callback); |
|---|
| 894 |
} |
|---|
| 895 |
|
|---|
| 896 |
self::$inspect_callbacks[$class][$column][] = $callback; |
|---|
| 897 |
} |
|---|
| 898 |
|
|---|
| 899 |
|
|---|
| 900 |
|
|---|
| 901 |
|
|---|
| 902 |
|
|---|
| 903 |
@param |
|---|
| 904 |
@param |
|---|
| 905 |
@param |
|---|
| 906 |
@return |
|---|
| 907 |
|
|---|
| 908 |
static public function registerObjectifyCallback($class, $column, $callback) |
|---|
| 909 |
{ |
|---|
| 910 |
$class = self::getClass($class); |
|---|
| 911 |
|
|---|
| 912 |
if (!isset(self::$objectify_callbacks[$class])) { |
|---|
| 913 |
self::$objectify_callbacks[$class] = array(); |
|---|
| 914 |
} |
|---|
| 915 |
|
|---|
| 916 |
if (is_string($callback) && strpos($callback, '::') !== FALSE) { |
|---|
| 917 |
$callback = explode('::', $callback); |
|---|
| 918 |
} |
|---|
| 919 |
|
|---|
| 920 |
self::$objectify_callbacks[$class][$column] = $callback; |
|---|
| 921 |
|
|---|
| 922 |
self::$cache['objectify'] = array(); |
|---|
| 923 |
} |
|---|
| 924 |
|
|---|
| 925 |
|
|---|
| 926 |
|
|---|
| 927 |
|
|---|
| 928 |
|
|---|
| 929 |
|
|---|
| 930 |
|
|---|
| 931 |
|
|---|
| 932 |
|
|---|
| 933 |
|
|---|
| 934 |
|
|---|
| 935 |
|
|---|
| 936 |
|
|---|
| 937 |
@param |
|---|
| 938 |
@param |
|---|
| 939 |
@return |
|---|
| 940 |
|
|---|
| 941 |
static public function registerRecordSetMethod($method, $callback) |
|---|
| 942 |
{ |
|---|
| 943 |
if (is_string($callback) && strpos($callback, '::') !== FALSE) { |
|---|
| 944 |
$callback = explode('::', $callback); |
|---|
| 945 |
} |
|---|
| 946 |
self::$record_set_method_callbacks[$method] = $callback; |
|---|
| 947 |
} |
|---|
| 948 |
|
|---|
| 949 |
|
|---|
| 950 |
|
|---|
| 951 |
|
|---|
| 952 |
|
|---|
| 953 |
|
|---|
| 954 |
|
|---|
| 955 |
|
|---|
| 956 |
|
|---|
| 957 |
|
|---|
| 958 |
|
|---|
| 959 |
|
|---|
| 960 |
|
|---|
| 961 |
|
|---|
| 962 |
|
|---|
| 963 |
@param |
|---|
| 964 |
@param |
|---|
| 965 |
@return |
|---|
| 966 |
|
|---|
| 967 |
static public function registerReflectCallback($class, $callback) |
|---|
| 968 |
{ |
|---|
| 969 |
$class = self::getClass($class); |
|---|
| 970 |
|
|---|
| 971 |
if (!isset(self::$reflect_callbacks[$class])) { |
|---|
| 972 |
self::$reflect_callbacks[$class] = array(); |
|---|
| 973 |
} elseif (in_array($callback, self::$reflect_callbacks[$class])) { |
|---|
| 974 |
return; |
|---|
| 975 |
} |
|---|
| 976 |
|
|---|
| 977 |
if (is_string($callback) && strpos($callback, '::') !== FALSE) { |
|---|
| 978 |
$callback = explode('::', $callback); |
|---|
| 979 |
} |
|---|
| 980 |
|
|---|
| 981 |
self::$reflect_callbacks[$class][] = $callback; |
|---|
| 982 |
} |
|---|
| 983 |
|
|---|
| 984 |
|
|---|
| 985 |
|
|---|
| 986 |
|
|---|
| 987 |
|
|---|
| 988 |
@param |
|---|
| 989 |
@param |
|---|
| 990 |
@param |
|---|
| 991 |
@return |
|---|
| 992 |
|
|---|
| 993 |
static public function registerReplicateCallback($class, $column, $callback) |
|---|
| 994 |
{ |
|---|
| 995 |
$class = self::getClass($class); |
|---|
| 996 |
|
|---|
| 997 |
if (!isset(self::$replicate_callbacks[$class])) { |
|---|
| 998 |
self::$replicate_callbacks[$class] = array(); |
|---|
| 999 |
} |
|---|
| 1000 |
|
|---|
| 1001 |
if (is_string($callback) && strpos($callback, '::') !== FALSE) { |
|---|
| 1002 |
$callback = explode('::', $callback); |
|---|
| 1003 |
} |
|---|
| 1004 |
|
|---|
| 1005 |
self::$replicate_callbacks[$class][$column] = $callback; |
|---|
| 1006 |
} |
|---|
| 1007 |
|
|---|
| 1008 |
|
|---|
| 1009 |
|
|---|
| 1010 |
|
|---|
| 1011 |
|
|---|
| 1012 |
@param |
|---|
| 1013 |
@param |
|---|
| 1014 |
@param |
|---|
| 1015 |
@return |
|---|
| 1016 |
|
|---|
| 1017 |
static public function registerScalarizeCallback($class, $column, $callback) |
|---|
| 1018 |
{ |
|---|
| 1019 |
$class = self::getClass($class); |
|---|
| 1020 |
|
|---|
| 1021 |
if (!isset(self::$scalarize_callbacks[$class])) { |
|---|
| 1022 |
self::$scalarize_callbacks[$class] = array(); |
|---|
| 1023 |
} |
|---|
| 1024 |
|
|---|
| 1025 |
if (is_string($callback) && strpos($callback, '::') !== FALSE) { |
|---|
| 1026 |
$callback = explode('::', $callback); |
|---|
| 1027 |
} |
|---|
| 1028 |
|
|---|
| 1029 |
self::$scalarize_callbacks[$class][$column] = $callback; |
|---|
| 1030 |
} |
|---|
| 1031 |
|
|---|
| 1032 |
|
|---|
| 1033 |
|
|---|
| 1034 |
|
|---|
| 1035 |
|
|---|
| 1036 |
|
|---|
| 1037 |
|
|---|
| 1038 |
@internal |
|---|
| 1039 |
|
|---|
| 1040 |
@param |
|---|
| 1041 |
@param |
|---|
| 1042 |
@param |
|---|
| 1043 |
@return |
|---|
| 1044 |
|
|---|
| 1045 |
static public function replicate($class, $column, $value) |
|---|
| 1046 |
{ |
|---|
| 1047 |
if (!empty(self::$replicate_callbacks[$class][$column])) { |
|---|
| 1048 |
return call_user_func(self::$replicate_callbacks[$class][$column], $class, $column, $value); |
|---|
| 1049 |
} |
|---|
| 1050 |
|
|---|
| 1051 |
if (!is_object($value)) { |
|---|
| 1052 |
return $value; |
|---|
| 1053 |
} |
|---|
| 1054 |
|
|---|
| 1055 |
return clone $value; |
|---|
| 1056 |
} |
|---|
| 1057 |
|
|---|
| 1058 |
|
|---|
| 1059 |
|
|---|
| 1060 |
|
|---|
| 1061 |
|
|---|
| 1062 |
@internal |
|---|
| 1063 |
|
|---|
| 1064 |
@return |
|---|
| 1065 |
|
|---|
| 1066 |
static public function reset() |
|---|
| 1067 |
{ |
|---|
| 1068 |
self::$active_record_method_callbacks = array(); |
|---|
| 1069 |
self::$cache = array( |
|---|
| 1070 |
'parseMethod' => array(), |
|---|
| 1071 |
'getActiveRecordMethod' => array(), |
|---|
| 1072 |
'objectify' => array() |
|---|
| 1073 |
); |
|---|
| 1074 |
self::$class_database_map = array( |
|---|
| 1075 |
'fActiveRecord' => 'default' |
|---|
| 1076 |
); |
|---|
| 1077 |
self::$class_table_map = array(); |
|---|
| 1078 |
self::$column_names = array(); |
|---|
| 1079 |
self::$hook_callbacks = array(); |
|---|
| 1080 |
self::$inspect_callbacks = array(); |
|---|
| 1081 |
self::$objectify_callbacks = array(); |
|---|
| 1082 |
self::$record_names = array( |
|---|
| 1083 |
'fActiveRecord' => 'Active Record' |
|---|
| 1084 |
); |
|---|
| 1085 |
self::$record_set_method_callbacks = array(); |
|---|
| 1086 |
self::$reflect_callbacks = array(); |
|---|
| 1087 |
self::$replicate_callbacks = array(); |
|---|
| 1088 |
self::$scalarize_callbacks = array(); |
|---|
| 1089 |
} |
|---|
| 1090 |
|
|---|
| 1091 |
|
|---|
| 1092 |
|
|---|
| 1093 |
|
|---|
| 1094 |
|
|---|
| 1095 |
@internal |
|---|
| 1096 |
|
|---|
| 1097 |
@param |
|---|
| 1098 |
@param |
|---|
| 1099 |
@param |
|---|
| 1100 |
@return |
|---|
| 1101 |
|
|---|
| 1102 |
static public function scalarize($class, $column, $value) |
|---|
| 1103 |
{ |
|---|
| 1104 |
$class = self::getClass($class); |
|---|
| 1105 |
|
|---|
| 1106 |
if (!empty(self::$scalarize_callbacks[$class][$column])) { |
|---|
| 1107 |
return call_user_func(self::$scalarize_callbacks[$class][$column], $class, $column, $value); |
|---|
| 1108 |
} |
|---|
| 1109 |
|
|---|
| 1110 |
if (is_object($value) && is_callable(array($value, '__toString'))) { |
|---|
| 1111 |
return $value->__toString(); |
|---|
| 1112 |
} elseif (is_object($value)) { |
|---|
| 1113 |
return (string) $value; |
|---|
| 1114 |
} |
|---|
| 1115 |
|
|---|
| 1116 |
return $value; |
|---|
| 1117 |
} |
|---|
| 1118 |
|
|---|
| 1119 |
|
|---|
| 1120 |
|
|---|
| 1121 |
|
|---|
| 1122 |
|
|---|
| 1123 |
@param |
|---|
| 1124 |
@return |
|---|
| 1125 |
|
|---|
| 1126 |
static public function tablize($class) |
|---|
| 1127 |
{ |
|---|
| 1128 |
if (!isset(self::$class_table_map[$class])) { |
|---|
| 1129 |
self::$class_table_map[$class] = fGrammar::underscorize(fGrammar::pluralize($class)); |
|---|
| 1130 |
} |
|---|
| 1131 |
return self::$class_table_map[$class]; |
|---|
| 1132 |
} |
|---|
| 1133 |
|
|---|
| 1134 |
|
|---|
| 1135 |
|
|---|
| 1136 |
|
|---|
| 1137 |
|
|---|
| 1138 |
@return |
|---|
| 1139 |
|
|---|
| 1140 |
private function __construct() { } |
|---|
| 1141 |
} |
|---|
| 1142 |
|
|---|
| 1143 |
|
|---|
| 1144 |
|
|---|
| 1145 |
|
|---|
| 1146 |
will@flourishlib.com |
|---|
| 1147 |
|
|---|
| 1148 |
|
|---|
| 1149 |
|
|---|
| 1150 |
|
|---|
| 1151 |
|
|---|
| 1152 |
|
|---|
| 1153 |
|
|---|
| 1154 |
|
|---|
| 1155 |
|
|---|
| 1156 |
|
|---|
| 1157 |
|
|---|
| 1158 |
|
|---|
| 1159 |
|
|---|
| 1160 |
|
|---|
| 1161 |
|
|---|
| 1162 |
|
|---|
| 1163 |
|
|---|
| 1164 |
|
|---|
| 1165 |
|
|---|