src/Ubiquity/controllers/admin/viewers/ModelViewer.php
public function getModelDataElement($instance, $model, $modal) {
		$semantic = $this->jquery->semantic ();
		$fields = $this->controller->_getAdminData ()->getElementFieldNames ( $model );

		$dataElement = $semantic->dataElement ( "de", $instance );
		$pk = OrmUtils::getFirstKeyValue ( $instance );
		$dataElement->getInstanceViewer ()->setIdentifierFunction ( function () use ($pk) {
			return $pk;
		} );
		$dataElement->setFields ( $fields );
		$dataElement->setCaptions ( $this->getElementCaptions ( $fields, $model, $instance ) );

		$fkInstances = CRUDHelper::getFKIntances ( $instance, $model );
		foreach ( $fkInstances as $member => $fkInstanceArray ) {
			if (array_search ( $member, $fields ) !== false) {
				$dataElement->setValueFunction ( $member, function () use ($fkInstanceArray, $member) {
					return $this->getFkMemberElement ( $member, $fkInstanceArray ["objectFK"], $fkInstanceArray ["fkClass"], $fkInstanceArray ["fkTable"] );
				} );
			}
		}
		$this->addEditMemberFonctionality ( "dataElement" );
		return $dataElement;
	}
public function getModelDataElement($instance, $model, $modal) {
		$semantic = $this->jquery->semantic ();
		$fields = $this->controller->_getAdminData ()->getElementFieldNames ( $model );

		$dataElement = $semantic->dataElement ( "de", $instance );
		$pk = OrmUtils::getFirstKeyValue ( $instance );
		$dataElement->getInstanceViewer ()->setIdentifierFunction ( function () use ($pk) {
			return $pk;
		} );
		$dataElement->setFields ( $fields );
		$dataElement->setCaptions ( $this->getElementCaptions ( $fields, $model, $instance ) );

		$fkInstances = CRUDHelper::getFKIntances ( $instance, $model );
		foreach ( $fkInstances as $member => $fkInstanceArray ) {
			if (array_search ( $member, $fields ) !== false) {
				$dataElement->setValueFunction ( $member, function () use ($fkInstanceArray, $member) {
					return $this->getFkMemberElement ( $member, $fkInstanceArray ["objectFK"], $fkInstanceArray ["fkClass"], $fkInstanceArray ["fkTable"] );
				} );
			}
		}
		$this->addEditMemberFonctionality ( "dataElement" );
		return $dataElement;
	}
public function getModelDataElement ( $ instance , $ model , $ modal ) { $ semantic = $ this -> jquery -> semantic ( ) ; $ fields = $ this -> controller -> _getAdminData ( ) -> getElementFieldNames ( $ model ) ; $ dataElement = $ semantic -> dataElement ( "de" , $ instance ) ; $ pk = OrmUtils :: getFirstKeyValue ( $ instance ) ; $ dataElement -> getInstanceViewer ( ) -> setIdentifierFunction ( function ( ) use ( $ pk ) { return $ pk ; } ) ; $ dataElement -> setFields ( $ fields ) ; $ dataElement -> setCaptions ( $ this -> getElementCaptions ( $ fields , $ model , $ instance ) ) ; $ fkInstances = CRUDHelper :: getFKIntances ( $ instance , $ model ) ; foreach ( $ fkInstances as $ member => $ fkInstanceArray ) { if ( array_search ( $ member , $ fields ) !== false ) { $ dataElement -> setValueFunction ( $ member , function ( ) use ( $ fkInstanceArray , $ member ) { return $ this -> getFkMemberElement ( $ member , $ fkInstanceArray [ "objectFK" ] , $ fkInstanceArray [ "fkClass" ] , $ fkInstanceArray [ "fkTable" ] ) ; } ) ; } } $ this -> addEditMemberFonctionality ( "dataElement" ) ; return $ dataElement ; }
Returns a DataElement object for displaying the instance
Used in the display method of the CrudController
in display route

@param object $instance
@param string $model The model class name (long name)
@param boolean $modal
@return \Ajax\semantic\widgets\dataelement\DataElement
Returns a DataElement object for displaying the instance Used in the display method of the CrudController in display route