(non-PHPdoc).

@see \Sonata\AdminBundle\Admin\Admin::prePersist()
508560
public function prePersist($object)
    {
        /* @var $object MetaTagContent */
        $path = $this->getForm()->get('path')->getData();
        if (strpos('/', $path) !== false) {
            $path = '/'.$path;
        }
        try {
            $key = $this->keyGenerator->generateMetaTagKeyFromRelativePath($path, $this->getRouter(), $this->translator->getLocale());
            $object->setKeyword($key);
        } catch (\Exception $e) {
        }
    }
395966
public function prePersist(LifecycleEventArgs $args)
    {
        $entity = $args->getEntity();

        if (!$entity instanceof Image) {
            return null;
        }

        return $this->storeImage($entity);
    }
984975
public function prePersist(LifecycleEventArgs $eventArgs)
	{
		$entity = $eventArgs->getEntity();

		if ($entity instanceof TimestampableInterface) {
			$now = new \DateTime();
			$entity->setModificationTime($now);
			$entity->setCreationTime($now);
		}
	}
1255444
public function prePersist()
    {
        if (!$this->getDefaultProfile())
        {
            // When we create a new User, we automatically give them a Buyer profile
            $profile = new Profile();
            $profile->setName($this->getFullname());

            $location = new Location();
            $location->setName('Default');
            $location->setPostalCode($this->postal_code);

            $profile->addLocation($location);

            $this->addProfile($profile);
        }
    }
323808
public function prePersist($eventArgs)
    {
        $entity = $eventArgs->getEntity();

        foreach ($this->metadata->getManagedFields($entity) as $field) {
            $value = PropertyHelper::getValue($entity, $field);
            if (null !== $value) {
                $this->scheduleForUpload($value, $entity, $field);
            }
        }
    }
602318
private function prepareService()
    {
        /**
         * If CommodeCommonServiceProvider is not loaded yet, load it
         * and mark as registered in GhostServices
         */
        if (!($bound = $this->app->bound(ServiceShortCuts::CORE_INITIALIZED))) {
            $this->services(['LaravelCommode\Common\CommodeCommonServiceProvider']);
        }

        $withGhostServiceDo = function (GhostServices $appServices) use ($bound) {
            /**
             * If CommodeCommonServiceProvider is not loaded yet, load it
             * and mark as registered in GhostServices
             */
            if (!$bound) {
                $appServices->register('LaravelCommode\Common\CommodeCommonServiceProvider');
            }

            /**
             * Get and register service providers in ServiceManager
             */
            $services = $appServices->differUnique($this->uses(), true);

            /**
             * Register service proviers in laravel app
             * differing from already used ones
             */
            $this->services(array_diff($services, array_keys($this->app->getLoadedProviders())));

            /**
             * Mark current service as registered
             */
            $appServices->register(get_class($this));
        };

        $this->with(ServiceShortCuts::GHOST_SERVICE, $withGhostServiceDo);

        return $this;
    }
27005
public function prePersist(LifecycleEventArgs $args)
    {
        $entity = $args->getObject();

        if ($entity instanceof ContentRoute) {
            $template = $this->templates[$entity->getTemplateName()];

            $entity->setTemplate($template['template']);
            $entity->setController($template['controller']);
        }
    }
649951
protected function handlePrePersist()
    {
        $environment = $this->getEnvironment();
        if (null !== $this->preFunction) {
            \call_user_func($this->preFunction, $environment, $this->model, $this->originalModel);
        }

        $environment->getEventDispatcher()->dispatch(
            PrePersistModelEvent::NAME,
            new PrePersistModelEvent($environment, $this->model, $this->originalModel)
        );
    }
1115846
public function prePersist()
    {
        if (!$this->getRootAccount())
        {
            // Create set of accounts
            $this->createSetOfAccounts();
        }

        // Set slug for Profile
        if (!$this->slug)
        {
            $this->setSlug(\Gedmo\Sluggable\Util\Urlizer::urlize($this->getName()));
        }
    }
577304
public function prependResolver(EntryNameResolverInterface $resolver)
    {
        $priority = self::DEFAULT_PRIORITY;

        if (!$this->resolvers->isEmpty()) {
            $queue = $this->resolvers->getIterator();
            $queue->setExtractFlags(PriorityQueue::EXTR_PRIORITY);
            $extractedNode = $queue->extract();
            $priority = $extractedNode[0] + 1;
        }

        $this->resolvers->insert(
            [
                'instance' => $resolver,

            ],
            $priority
        );

        return $this;
    }
132290
public function prePersist(LifecycleEventArgs $event)
    {
        $entity = $event->getEntity();

        if ($entity instanceOf ImageInterface) {
            if ($entity->hasFile()) {
                $this->uploader->upload($entity);
            }
        }
    }
256402
public function prePersist(LifecycleEventArgs $args) : void
    {
        $entity = $args->getEntity();

        if ($entity instanceof CreatedInterface) {
            $entity->setCreatedAt(new \DateTime());
        }
    }
259278
protected function prepareForPresentation()
    {
        if ($this->prepared) {
            return;
        }

        if ($this->isMenuCached()) {
            list($layout, $permissionsIndex) = $this->retrieveMenuFromCache();
        } else {
            list($layout, $permissionsIndex) = $this->interpretMenuData();
        }

        if ( ! $this->ignorePermission && ! $this->auth->admin()) {
            $layout = $this->permissionsFilter->filterLayout($layout, $this->auth->user(), $permissionsIndex);
        }

        $this->menuLayout           = new Collection($layout->layout());
        $this->alternativePresences = new Collection($layout->alternative());

        $this->prepared = true;
    }
137090
public function preparar()
    {
        // Validamos la sentencia a preparar
        if (empty($this->sentencia)) {
            if ($this->arrojarExcepciones) {
                throw new \InvalidArgumentException('La sentencia a preparar se encuentra vacia.');
            }
        }

        return $this->pdo->prepare($this->sentencia);
    }
41682
public function prepend(ContainerBuilder $container)
    {
        if ($container->hasExtension('sulu_search')) {
            $container->prependExtensionConfig(
                'sulu_search',
                [
                    'indexes' => [
                        'contact' => [
                            'security_context' => 'sulu.contact.people',
                        ],
                        'account' => [
                            'security_context' => 'sulu.contact.organizations',
                        ],
                    ],
                ]
            );
        }

        if ($container->hasExtension('sulu_media')) {
            $container->prependExtensionConfig(
                'sulu_media',
                [
                    'system_collections' => [
                        'sulu_contact' => [
                            'meta_title' => ['en' => 'Sulu contacts', 'de' => 'Sulu Kontakte'],
                            'collections' => [
                                'contact' => [
                                    'meta_title' => ['en' => 'People', 'de' => 'Personen'],
                                ],
                                'account' => [
                                    'meta_title' => ['en' => 'Organizations', 'de' => 'Organisationen'],
                                ],
                            ],
                        ],
                    ],
                ]
            );
        }

        if ($container->hasExtension('sulu_admin')) {
            $container->prependExtensionConfig(
                'sulu_admin',
                [
                    'lists' => [
                        'directories' => [
                            __DIR__ . '/../Resources/config/lists',
                        ],
                    ],
                    'forms' => [
                        'directories' => [
                            __DIR__ . '/../Resources/config/forms',
                        ],
                    ],
                    'resources' => [
                        'contacts' => [
                            'routes' => [
                                'list' => 'get_contacts',
                                'detail' => 'get_contact',
                            ],
                        ],
                        'accounts' => [
                            'routes' => [
                                'list' => 'get_accounts',
                                'detail' => 'get_account',
                            ],
                        ],
                        'contact_titles' => [
                            'routes' => [
                                'list' => 'get_contact-titles',
                            ],
                        ],
                        'contact_positions' => [
                            'routes' => [
                                'list' => 'get_contact-positions',
                            ],
                        ],
                    ],
                    'field_type_options' => [
                        'single_selection' => [
                            'single_account_selection' => [
                                'default_type' => 'auto_complete',
                                'resource_key' => 'accounts',
                                'types' => [
                                    'auto_complete' => [
                                        'display_property' => 'name',
                                        'search_properties' => ['number', 'name'],
                                    ],
                                    'list_overlay' => [
                                        'adapter' => 'table',
                                        'list_key' => 'accounts',
                                        'display_properties' => ['name'],
                                        'empty_text' => 'sulu_contact.no_account_selected',
                                        'icon' => 'su-house',
                                        'overlay_title' => 'sulu_contact.single_account_selection_overlay_title',
                                    ],
                                ],
                            ],
                            'single_contact_selection' => [
                                'default_type' => 'list_overlay',
                                'resource_key' => 'contacts',
                                'types' => [
                                    'list_overlay' => [
                                        'adapter' => 'table',
                                        'list_key' => 'contacts',
                                        'display_properties' => ['fullName'],
                                        'empty_text' => 'sulu_contact.no_contact_selected',
                                        'icon' => 'su-user',
                                        'overlay_title' => 'sulu_contact.single_contact_selection_overlay_title',
                                    ],
                                ],
                            ],
                            'single_contact_title_selection' => [
                                'default_type' => 'single_select',
                                'resource_key' => 'contact_titles',
                                'types' => [
                                    'single_select' => [
                                        'id_property' => 'id',
                                        'display_property' => 'title',
                                        'overlay_title' => 'sulu_contact.edit_title_overlay_title',
                                    ],
                                ],
                            ],
                            'single_contact_position_selection' => [
                                'default_type' => 'single_select',
                                'resource_key' => 'contact_positions',
                                'types' => [
                                    'single_select' => [
                                        'id_property' => 'id',
                                        'display_property' => 'position',
                                        'overlay_title' => 'sulu_contact.edit_position_overlay_title',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ]
            );
        }
    }
308761
public static function prepareForPantheon()
  {
    // Get rid of any .git directories that Composer may have added.
    // n.b. Ideally, there are none of these, as removing them may
    // impair Composer's ability to update them later. However, leaving
    // them in place prevents us from pushing to Pantheon.
    $dirsToDelete = [];
    $finder = new Finder();
    foreach (
      $finder
        ->directories()
        ->in(getcwd())
        ->ignoreDotFiles(false)
        ->ignoreVCS(false)
        ->depth('> 0')
        ->name('.git')
      as $dir) {
      $dirsToDelete[] = $dir;
    }
    $fs = new Filesystem();
    $fs->remove($dirsToDelete);

    // Fix up .gitignore: remove everything above the "::: cut :::" line
    $gitignoreFile = getcwd() . '/.gitignore';
    $gitignoreContents = file_get_contents($gitignoreFile);
    $gitignoreContents = preg_replace('/.*::: cut :::*/s', '', $gitignoreContents);
    file_put_contents($gitignoreFile, $gitignoreContents);
  }
1038211
public static function preParse(\SplFileInfo $file, ContainerBuilder $container, array $configs = []): void
    {
        self::proccessFile($file, $container, $configs, true);
    }