Ejemplo n.º 1
0
 /**
  * fillHasMethods
  *
  * When getIterator is called the first time, the list of "has" methods is
  * set in a static attribute to boost performances.
  *
  * @access  protected
  * @param   FlexibleEntity   $entity
  * @return  null
  */
 protected static function fillHasMethods(FlexibleEntity $entity)
 {
     parent::fillHasMethods($entity);
     static::$has_methods = array_filter(static::$has_methods, function ($e) {
         return $e !== 'Role';
     });
 }
Ejemplo n.º 2
0
 /**
  * fillHasMethods
  *
  * When getIterator is called the first time, the list of "has" methods is
  * set in a static attribute to boost performances.
  *
  * @access  protected
  * @param   FlexibleEntity   $entity
  * @return  null
  */
 protected static function fillHasMethods(FlexibleEntity $entity)
 {
     static::$has_methods = [];
     foreach (get_class_methods($entity) as $method) {
         if (preg_match('/^has([A-Z].*)$/', $method, $matches)) {
             static::$has_methods[] = $matches[1];
         }
     }
 }