User Tools

Site Tools


neos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
neos [2015/10/03 23:44] adminneos [2019/02/14 13:18] (current) – [Use sqlite] admin
Line 50: Line 50:
 === Inline Image URI === === Inline Image URI ===
  
 +<code>
 {media:uri.image(image:"{image.filepath}", maximumWidth: 500)} {media:uri.image(image:"{image.filepath}", maximumWidth: 500)}
 +</code>
 +
 +
 +==== Use sqlite ====
 +
 +Set path to database ''file/url''
 +
 +<code yaml>
 +Neos:
 +  Flow:
 +    persistence:
 +      # For a reference of the possible options, take a look at
 +      # https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html
 +      backendOptions:
 +        driver: 'pdo_sqlite'
 +        url: 'sqlite:///%FLOW_PATH_DATA%/app.db'
 +</code>
 +
 +Make sure you create the database with this command:
 +
 +<code bash>
 +./flow doctrine:create
 +</code>
 +
 +===== Sample map properties =====
 +
 +<code php>
 +/**
 +* Convert array to Company Model
 +*/
 +$companies = [];
 +foreach ($csv->data as $key => $company) {
 +     $array = $this->generalUtility->getArrayFields($company);
 +     $array['company']['companyData'][] = $array['companyData'];
 +     $companies[] = $array['company'];
 +}
 +
 +/**
 + * Save all companies
 + */
 +foreach ($companies as $company) {
 +    $company = $this->propertyMapper->convert($company, Company::class);
 +    $this->companyRepository->add($company);
 +}
 +
 +</code>
  
neos.1443908677.txt.gz · Last modified: 2015/10/03 23:44 by admin