     1: <?php
     2:
     3: /*
     4:  * This file is part of the CRUDlex package.
     5:  *
     6:  * (c) Philip Lehmann-Böhm <philip@philiplb.de>
     7:  *
     8:  * For the full copyright and license information, please view the LICENSE
     9:  * file that was distributed with this source code.
    10:  */
    11:
    12: namespace CRUDlex;
    13:
    14: use CRUDlex\CRUDData;
    15: use CRUDlex\CRUDEntityDefinition;
    16: use CRUDlex\CRUDFileProcessorInterface;
    17:
    18: /**
    19:  * An interface used by the {@see CRUDServiceProvider} to construct
    20:  * {@see CRUDData} instances. By implementing this and handing it into
    21:  * the service provider, the user can control what database (-variation) he
    22:  * wants to use.
    23:  */
    24: interface CRUDDataFactoryInterface {
    25:
    26:     /**
    27:      * Creates instances.
    28:      *
    29:      * @param CRUDEntityDefinition $definition
    30:      * the definition of the entities managed by the to be created instance
    31:      * @param CRUDFileProcessorInterface $fileProcessor
    32:      * the file processor managing uploaded files
    33:      *
    34:      * @return CRUDData
    35:      * the newly created instance
    36:      */
    37:     public function createData(CRUDEntityDefinition $definition, CRUDFileProcessorInterface $fileProcessor);
    38:
    39: }
    40: