PHP code example of lochmueller / autoloader

1. Go to this page and download the library: Download lochmueller/autoloader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lochmueller / autoloader example snippets


/**

* @DatabaseTable(tableName="")
* @DatabaseKey([key=""|argumentName=""])
* @DatabaseField(type=""[, sql=""])
*
* @EnableRichText([value=""|argumentName=""])
* @Hook(locations={})
* @NoCache([value=""|argumentName=""])
* @NoHeader([value=""|argumentName=""])
* @ParentClass(parentClass="")
* @Plugin([value=""|argumentName=""])
* @RecordType(recordType="")

* @SignalClass([value=""|argumentName=""])
* @SignalName([value=""|argumentName=""])
* @SignalPriority([value=""|argumentName=""])

* @SmartExclude(excludes="{}")
* @WizardTab(config="")
*
*/

\HDNET\Autoloader\Loader::extTables(
    'vendorName',
    'extensionKey',
    [
    	'SmartObjects',
    	'TcaFiles'
    ]
);

\HDNET\Autoloader\Loader::extLocalconf(
	'vendorName',
	'extensionKey'
	[
		'SmartObjects',
		'TcaFiles'
	]
);

namespace vendorName\extensionKey\Domain\Model;

use HDNET\Autoloader\Annotation\DatabaseField;
use HDNET\Autoloader\Annotation\DatabaseTable;

use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
/**
 * Create a test-table for this model with this annotation.
 * @DatabaseTable(tableName="test")
 */
class Test extends AbstractEntity {

	/**
	 * A basic field
	 *
	 * @var string
	 * @DatabaseField(type="string")
	 */
	protected $textField;

	/**
	 * A boolean field
	 *
	 * @var bool
	 * @DatabaseField(type="bool")
	 */
	protected $boolField;

	/**
	 * File example
	 *
	 * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
	 * @DatabaseField(type="string")
	 */
	protected $file;

	/**
	 * Custom (variable that has a custom DB type)
	 *
	 * @var int
	 * @DatabaseField(type="int", sql="int(11) DEFAULT '0' NOT NULL")
	 */
	protected $customField;

	// add here some Getters and Setters
}