Changeset 911

Show
Ignore:
Timestamp:
09/12/07 11:54:49 (1 year ago)
Author:
mikey
Message:

use list of forbidden methods instead of checking declaring class

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/rdbms/persistence/stubPersistenceHelper.php

    r907 r911  
    2727{ 
    2828    /** 
     29     * list of forbidden methods 
     30     * 
     31     * @var  array<string> 
     32     */ 
     33    protected $forbiddenMethods = array('getClass', 
     34                                        'getPackage', 
     35                                        'getClassName', 
     36                                        'getPackageName', 
     37                                        'getSerialized' 
     38                                  ); 
     39 
     40    /** 
    2941     * helper method to create the correct table definition 
    3042     * 
     
    5466    protected function getTableColumn(stubReflectionMethod $method) 
    5567    { 
    56         if ($method->isStatic() === true || $method->isPublic() === false || $method->hasAnnotation('Transient') === true) { 
     68        if ($method->isStatic() === true || $method->isPublic() === false 
     69                || in_array($method->getName(), $this->forbiddenMethods) === true 
     70                || $method->hasAnnotation('Transient') === true) { 
    5771            return null; 
    5872        } 
     
    6074        if ($method->hasAnnotation('DBColumn') === true) { 
    6175            $column = $method->getAnnotation('DBColumn')->getTableColumn(); 
    62         } elseif (substr($method->getName(), 0, 3) !== 'get') { 
    63             return null; 
    64         } elseif (in_array($method->getDeclaringClass()->getName(), array('stubBaseObject', 'stubSerializableObject'))) { 
     76        } elseif (substr($method->getName(), 0, 3) !== 'get' && substr($method->getName(), 0, 2) !== 'is') { 
    6577            return null; 
    6678        } else {