private function createFieldControl($field, $translateId, $default = null)
    {
        $fieldControl = null;
        $fieldValue = $default;
        switch ($field->type) {
            case 'text':
                $fieldControl = new Text($field, $this->entityId, $this->locale);
                break;
            case 'number':
                $fieldControl = new Number($field, $this->entityId, $this->locale);
                break;
            case 'textarea':
                $fieldControl = new Textarea($field, $this->entityId, $this->locale);
                break;
            case 'wysiwyg':
                $fieldControl = new Wysiwyg($field, $this->entityId, $this->locale);
                break;
            case 'file':
                $fieldControl = new File($field, $this->entityId, $this->locale);
                break;
            case 'image':
                $fieldControl = new Image($field, $this->entityId, $this->locale);
                break;
        }
        // assign entity type class to field to use for save data;
        $fieldControl->setEntityType($this->entityType);
        $fieldControl->setRepeaterId($this->fieldId);
        $fieldControl->setTranslateId($translateId);

        $fieldControl->init($fieldValue);

        return $fieldControl;
    }
private function createFieldControl($field, $translateId, $default = null)
    {
        $fieldControl = null;
        $fieldValue = $default;
        switch ($field->type) {
            case 'text':
                $fieldControl = new Text($field, $this->entityId, $this->locale);
                break;
            case 'number':
                $fieldControl = new Number($field, $this->entityId, $this->locale);
                break;
            case 'textarea':
                $fieldControl = new Textarea($field, $this->entityId, $this->locale);
                break;
            case 'wysiwyg':
                $fieldControl = new Wysiwyg($field, $this->entityId, $this->locale);
                break;
            case 'file':
                $fieldControl = new File($field, $this->entityId, $this->locale);
                break;
            case 'image':
                $fieldControl = new Image($field, $this->entityId, $this->locale);
                break;
        }
        // assign entity type class to field to use for save data;
        $fieldControl->setEntityType($this->entityType);
        $fieldControl->setRepeaterId($this->fieldId);
        $fieldControl->setTranslateId($translateId);

        $fieldControl->init($fieldValue);

        return $fieldControl;
    }
private function createFieldControl ( $ field , $ translateId , $ default = null ) { $ fieldControl = null ; $ fieldValue = $ default ; switch ( $ field -> type ) { case 'text' : $ fieldControl = new Text ( $ field , $ this -> entityId , $ this -> locale ) ; break ; case 'number' : $ fieldControl = new Number ( $ field , $ this -> entityId , $ this -> locale ) ; break ; case 'textarea' : $ fieldControl = new Textarea ( $ field , $ this -> entityId , $ this -> locale ) ; break ; case 'wysiwyg' : $ fieldControl = new Wysiwyg ( $ field , $ this -> entityId , $ this -> locale ) ; break ; case 'file' : $ fieldControl = new File ( $ field , $ this -> entityId , $ this -> locale ) ; break ; case 'image' : $ fieldControl = new Image ( $ field , $ this -> entityId , $ this -> locale ) ; break ; } // assign entity type class to field to use for save data; $ fieldControl -> setEntityType ( $ this -> entityType ) ; $ fieldControl -> setRepeaterId ( $ this -> fieldId ) ; $ fieldControl -> setTranslateId ( $ translateId ) ; $ fieldControl -> init ( $ fieldValue ) ; return $ fieldControl ; }
Set field control data.

@param $field
@param $translateId
@param null $default

@return File|Image|Number|Text|Textarea|Wysiwyg|null
Set field control data .