eZ Community » Forums » eZ Publish 5 Platform » eZ Publish 5 - Inserting Matrix data...
expandshrink

eZ Publish 5 - Inserting Matrix data in to the DB

eZ Publish 5 - Inserting Matrix data in to the DB

Friday 22 September 2017 8:11:51 am - 2 replies

How do i insert data in to the DB for Matrix type ? and which like structure will it have ? can anyone show me a small example ? I`m trying insert matrix data from php file

Saturday 23 September 2017 8:47:37 pm

Hello Ni,

The creating of ezcontentobject / ezcontenttreenodeobject content objects (objects / nodes) which use the ezmatrix datatype has been well documented else where so I'll skip that.

Just rememeber that the only thing that makes the working with a matrix datatype attribute complicated is that the "storage format" for the data is XML. So you must create your xml document before you simply store it within the content object attribute.

Here is an example:

https://gist.github.com/brookinsconsulting/fd5a6ea3abb70d8b81d10dbbcf32a654

Cheers,
Heath

Modified on Saturday 23 September 2017 8:52:33 pm by // Heath

Monday 25 September 2017 9:41:35 am

Hi Heath!

Thank you for reply.

Yes you are right , i  looked  records in DB  for Matrix data-type  and it's similar  as you said!  so now i  store  data  like this , the code of  inserting data i found in ez Publish source  ))

if someone  would   have issue like me , can access to this file and  find  inserting Matrix data in to DB , it's starts from 792 Line for my case or  can search in file this line  'case "ezmatrix":'

this is a file path in eZ Publish 5.
web/extension/ezodf/classes/ezooimport.php

Cheers, Nick )

Modified on Monday 25 September 2017 9:42:15 am by Ni ck

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from