Defines the object mappers registered in the orm.

@param OrmDefinition $orm

@return void
1904
protected function define(OrmDefinition $orm)
    {
        $orm->valueObjects([
                Directory::class => DirectoryMapper::class,
                File::class      => FileMapper::class,
                Image::class     => ImageMapper::class,
        ]);
    }
724174
public function setModel(\Parable\ORM\Model $model)
    {
        $this->model = $model->reset();
        return $this;
    }
1179885
public function apply(Builder $query, $or = false)
    {
        $field_alias = $this->field_alias;

        if(is_array($this->value))
        {
            if($or)
            {
                $query->orWhereNotIn($field_alias, $this->value);
            }
            else
            {
                $query->whereNotIn($field_alias, $this->value);
            }
        }
        else
        {
            if($or)
            {
                $query->orWhere($field_alias, '!=', $this->value);
            }
            else
            {
                $query->where($field_alias, '!=', $this->value);
            }
        }
    }
692110
public function apply(Builder $query, $or = false)
    {
        $field_alias = $this->field_alias;

        if(is_array($this->value))
        {
            if($or)
            {
                $query->orWhereIn($field_alias, $this->value);
            }
            else
            {
                $query->whereIn($field_alias, $this->value);
            }
        }
        else
        {
            if($or)
            {
                $query->orWhere($field_alias, '=', $this->value);
            }
            else
            {
                $query->where($field_alias, '=', $this->value);
            }
        }
    }
453704
protected function define(MapperDefinition $map)
    {
        $map->type(TimeOfDay::class);

        $map->property(TimeOfDay::DATE_TIME)->to($this->columnName)->asTime();
    }
417227
public function load(ObjectManager $manager)
    {
        foreach (['de' => 'German', 'fr' => 'French'] as $id => $name) {
            $lang = new Language;
            $lang->setId($id);
            $lang->setName(Translatable::createFromOriginalString($name));
            $manager->persist($lang);
        }

        $manager->flush();
    }
676674
protected function define(OrmDefinition $orm)
    {
        $orm->encompassAll([
                new ColourOrm(),
                new DateTimeOrm(),
                new GeoOrm(),
                new FileSystemOrm(),
                new MoneyOrm(),
                new WebOrm(),
        ]);
    }
1064374
protected function define(OrmDefinition $orm)
    {
        $orm->entities([
            BlogCategory::class       => BlogCategoryMapper::class,
            BlogAuthor::class         => BlogAuthorMapper::class,
            BlogArticle::class        => BlogArticleMapper::class,
            BlogArticleComment::class => BlogArticleCommentMapper::class,
        ]);
    }
707090
public function registerStandardObjects()
	{
		$this->extensionMap = new ExtensionMap();
		$this->extensions = $this->extensionMap->getRegisteredExtensionNames();
		$this->finder->files();
	}
12794
public function load(ObjectManager $manager)
    {
        /**
         * @var ObjectDirector $manufacturerDirector
         */
        $manufacturerDirector = $this->getDirector('manufacturer');

        $manufacturer = $manufacturerDirector
            ->create()
            ->setName('manufacturer')
            ->setSlug('manufacturer')
            ->setDescription('manufacturer description');

        $manufacturerDirector->save($manufacturer);
        $this->addReference('manufacturer', $manufacturer);
    }
694624
protected function define(MapperDefinition $map)
    {
        $map->type(ContactEnquiry::class);
        $map->toTable('contact_enquiries');

        $map->idToPrimaryKey('id');

        $map->embedded(ContactEnquiry::EMAIL)->using(new EmailAddressMapper('email'));
        $map->property(ContactEnquiry::NAME)->to('name')->asVarchar(255);
        $map->property(ContactEnquiry::SUBJECT)->to('subject')->asVarchar(255);
        $map->property(ContactEnquiry::MESSAGE)->to('message')->asVarchar(8000);
        $map->embedded(ContactEnquiry::CREATED_AT)->using(new DateTimeMapper('created_at'));
    }
1264392
public function load(ObjectManager $manager)
    {
        $site2 = $this->getReference('site2');
        $site2->addBlock('slideshow');
        $site2->addBlock('gallery');

        $manager->flush();
    }
439625
public function setParam($param): void
    {
        // prepare params data
        // setup param types
        if (strpos($param, '$') === false) {
            return;
        }

        [$type, $key] = preg_split('/[ $]+/', $param);

        $this->params[$key] = trim($type);
    }
71103
protected function mappingIntermediaryModel($intermediaryModel)
    {
        if ($intermediaryModel instanceof Model) {
            $this->intermediaryModel = $intermediaryModel;
            $this->intermediaryTable = $intermediaryModel->table;
            $this->intermediaryPrimaryKey = $this->intermediaryModel->primaryKey;
        } elseif (class_exists($intermediaryModel)) {
            $this->intermediaryModel = models($intermediaryModel);
            $this->intermediaryTable = $this->intermediaryModel->table;
            $this->intermediaryPrimaryKey = $this->intermediaryModel->primaryKey;
        } else {
            $this->intermediaryModel = new class extends Model
            {
            };
            $this->intermediaryModel->table = $this->referenceTable = $intermediaryModel;
        }
    }
116226
public function load(ObjectManager $manager)
    {
        /**
         * Product.
         *
         * @var CategoryInterface     $category
         * @var ManufacturerInterface $manufacturer
         * @var CurrencyInterface     $currency
         * @var ObjectDirector        $productDirector
         */
        $category = $this->getReference('category');
        $rootCategory = $this->getReference('rootCategory');
        $manufacturer = $this->getReference('manufacturer');
        $currency = $this->getReference('currency-dollar');
        $productDirector = $this->getDirector('product');

        $product = $productDirector
            ->create()
            ->setName('product')
            ->setSlug('product')
            ->setDescription('my product description')
            ->setShortDescription('my product short description')
            ->addCategory($category)
            ->setPrincipalCategory($category)
            ->setManufacturer($manufacturer)
            ->setStock(10)
            ->setPrice(Money::create(1000, $currency))
            ->setSku('product-sku-code-1')
            ->setHeight(10)
            ->setWidth(15)
            ->setDepth(20)
            ->setWeight(100)
            ->setEnabled(true);

        $productDirector->save($product);
        $this->addReference('product', $product);

        /**
         * Reduced Product.
         */
        $productReduced = $productDirector
            ->create()
            ->setName('product-reduced')
            ->setSlug('product-reduced')
            ->setDescription('my product-reduced description')
            ->setShortDescription('my product-reduced short description')
            ->setShowInHome(true)
            ->setStock(5)
            ->setPrice(Money::create(1000, $currency))
            ->setReducedPrice(Money::create(500, $currency))
            ->setHeight(25)
            ->setWidth(30)
            ->setDepth(35)
            ->setWeight(200)
            ->setEnabled(true);

        $this->storeProductImage(
            $productReduced,
            'product.jpg'
        );

        $productDirector->save($productReduced);
        $this->addReference('product-reduced', $productReduced);

        /**
         * Product with variants.
         *
         * @var ProductInterface $productWithVariants
         */
        $productWithVariants = $productDirector
            ->create()
            ->setName('Product with variants')
            ->setSku('product-sku-code-variant-1')
            ->setSlug('product-with-variants')
            ->setDescription('my product with variants description')
            ->setShortDescription('my product with variants short description')
            ->addCategory($category)
            ->setPrincipalCategory($category)
            ->setManufacturer($manufacturer)
            ->setStock(10)
            ->setPrice(Money::create(1000, $currency))
            ->setHeight(40)
            ->setWidth(45)
            ->setDepth(50)
            ->setWeight(500)
            ->setEnabled(true);

        $productDirector->save($productWithVariants);
        $this->addReference('product-with-variants', $productWithVariants);

        /**
         * Root category product.
         *
         * @var ProductInterface $rootCategoryProduct
         */
        $rootCategoryProduct = $productDirector
            ->create()
            ->setName('Root category product')
            ->setSlug('root-category-product')
            ->setDescription('my product description')
            ->setShortDescription('my product short description')
            ->addCategory($rootCategory)
            ->setPrincipalCategory($rootCategory)
            ->setManufacturer($manufacturer)
            ->setStock(10)
            ->setPrice(Money::create(500, $currency))
            ->setSku('product-sku-code-3')
            ->setHeight(10)
            ->setWidth(15)
            ->setDepth(20)
            ->setWeight(100)
            ->setEnabled(true);

        $productDirector->save($rootCategoryProduct);
        $this->addReference('rootCategoryProduct', $rootCategoryProduct);
    }
495736
protected function define(MapperDefinition $map)
    {
        $map->type(DateTime::class);

        $map->property(DateTime::DATE_TIME)->to($this->columnName)->asDateTime();
    }
615368
protected function mappingReferenceModel($referenceModel)
    {
        if ($referenceModel instanceof Model) {
            $this->referenceModel = $referenceModel;
            $this->referenceTable = $this->referenceModel->table;
            $this->referencePrimaryKey = $this->referenceModel->primaryKey;
        } elseif (class_exists($referenceModel)) {
            $this->referenceModel = models($referenceModel);
            $this->referenceTable = $this->referenceModel->table;
            $this->referencePrimaryKey = $this->referenceModel->primaryKey;
        } else {
            $this->referenceModel = new class extends Model
            {
            };
            $this->referenceModel->table = $this->referenceTable = $referenceModel;
            $this->referenceModel->primaryKey = $this->referencePrimaryKey = 'id';
        }

        if (empty($this->currentForeignKey)) {
            $this->currentForeignKey = $this->referencePrimaryKey . '_' . str_replace([
                    't_',
                    'tm_',
                    'tr_',
                    'tb_',
                ], '', $this->referenceTable);
        }
    }