/**
  * Generated column definition for a model's mixins
  * @param string $modelClassName
  * @param $messageLogger
  * @return array
  * @throws CException
  */
 public static function resolve($modelClassName, &$messageLogger)
 {
     $messageLogger->addInfoMessage(Zurmo::t('Core', 'Building Column definitions for mixins of {{model}}', array('{{model}}' => $modelClassName)));
     $columns = array();
     if (!empty($modelClassName) && @class_exists($modelClassName)) {
         $mixins = $modelClassName::getMixedInModelClassNames();
         foreach ($mixins as $mixinModelClassName) {
             $column = RedBeanModelMixinToColumnAdapter::resolve($mixinModelClassName);
             if ($column) {
                 $columns[] = $column;
             } else {
                 $errorMessage = Zurmo::t('Core', 'Failed to resolve {{model}}.{{mixinModelClassName}} to column', array('{{model}}' => $modelClassName, '{{mixinModelClassName}}' => $mixinModelClassName));
                 $messageLogger->addErrorMessage($errorMessage);
                 throw new CException($errorMessage);
             }
         }
     }
     $messageLogger->addInfoMessage(Zurmo::t('Core', 'Column definitions for mixins Built'));
     return $columns;
 }
 /**
  * @depends testResolveWithClassThatCannotHaveBeen
  */
 public function testResolve()
 {
     $modelClassName = 'Person';
     $column = RedBeanModelMixinToColumnAdapter::resolve($modelClassName);
     $this->assertNotEmpty($column);
     $this->assertCount(6, $column);
     $this->assertArrayHasKey('name', $column);
     $this->assertArrayHasKey('type', $column);
     $this->assertArrayHasKey('unsigned', $column);
     $this->assertArrayHasKey('notNull', $column);
     $this->assertArrayHasKey('collation', $column);
     $this->assertArrayHasKey('default', $column);
     $this->assertEquals('person_id', $column['name']);
     $this->assertEquals('INT(11)', $column['type']);
     $this->assertEquals('UNSIGNED', $column['unsigned']);
     $this->assertEquals('NULL', $column['notNull']);
     // Not Coding Standard
     $this->assertNull($column['collation']);
     $this->assertEquals('DEFAULT NULL', $column['default']);
     // Not Coding Standard
 }