HEX
Server: Apache
System: Linux v38079.2is.nl 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: democfellows (10015)
PHP: 8.1.34
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/creativefellows.nl/fvr.creativefellows.nl/src/Domain/Field/FieldData.php
<?php

namespace App\Domain\Field;


/**
 * Lease Term data
 */
final class FieldData
{
			
	function __construct(array $data =null)
	{
		foreach((array) $data as $key => $val)
		{
			$this->$key = $val;
		}
		
	}
	
	public function name()
	{
		return $this->field_naam;
	}
	
	public function setValue($value)
	{
		switch( $this->formElement() )
		{
			default:
				$this->type = new TextType($value);
			break;
			
			case "link":
				$this->type = new LinkType($value);
			break;
			
			case "files":
				$this->type = new UploadType($value);
			break;
			
			
			case "image":
				$this->type = new ImageType($value);
			break;
			
			case "dragdrop":
				
				$this->type = new DragDropType();
				
				foreach((array) $value as $row)
				{	
					$html_row = new SectionRow($row);
					$this->type->set($html_row);
				}
		
			break;
		}
		
	}
		
	public function value($html_tag = null,$element_class=null)
	{
		return $this->type->value($html_tag,$element_class);
	}
	
	public function isDragDrop()
	{
		return $this->field_id == 46 ? true :false;
	}
	
	public function isEntryLinks()
	{
		return $this->field_id == 12 ? true :false;
	}
	
	public function translate()
	{
		return $this->translate == 1 ? true : false;
	}
	
	public function isLink()
	{
		return $this->form_element == "link" ? true : false;
		
	}
	
	public function hasTemplateData()
	{	
		return $this->link_data != 0 ? true :false;
	}
	
	private function formElement()
	{
		return $this->form_element;
	}
}