Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setUpdatedAt example
$product
->
setFormattedUpdatedAt
(
$this
->
formatDate
(
$product
->
getUpdatedAt
(
)
)
)
;
$product
->
setFormattedReleaseDate
(
$this
->
formatDate
(
$product
->
getReleaseDate
(
)
)
)
;
$product
->
addAttributes
(
$this
->
parseAttributes
(
$product
->
getAttributes
(
)
)
)
;
$product
->
setCreatedAt
(
null
)
;
$product
->
setUpdatedAt
(
null
)
;
$product
->
setReleaseDate
(
null
)
;
$product
->
setPrices
(
null
)
;
$product
->
setPriceRules
(
null
)
;
$product
->
setCheapestPriceRule
(
null
)
;
$product
->
setCheapestPrice
(
null
)
;
$product
->
setCheapestUnitPrice
(
null
)
;
$product
->
setAvailableCombinations
(
null
)
;
$product
->
setFullConfiguration
(
null
)
;
$product
->
resetStates
(
)
;
/** * @return MediaFolderCollection|MediaFolderEntity */
public
function
getInput
(
)
: EntityCollection|Entity
{
$parent
=
new
MediaFolderEntity
(
)
;
$parent
->
setId
(
'3e352be2d85846dd97529c0f6b544870'
)
;
$parent
->
setChildCount
(
1
)
;
$parent
->
setUseParentConfiguration
(
false
)
;
$parent
->
setCreatedAt
(
new
\
DateTime
(
'2012-08-15T00:00:00.000+00:00'
)
)
;
$parent
->
setUpdatedAt
(
new
\
DateTime
(
'2017-11-21T11:25:34.000+00:00'
)
)
;
$parent
->
internalSetEntityData
(
'media_folder',
new
FieldVisibility
(
[
]
)
)
;
$child
=
new
MediaFolderEntity
(
)
;
$child
->
setId
(
'5846dd97529c0f6b5448713e352be2d8'
)
;
$child
->
setChildCount
(
1
)
;
$child
->
setUseParentConfiguration
(
true
)
;
$child
->
setParentId
(
'3e352be2d85846dd97529c0f6b544870'
)
;
$child
->
setCreatedAt
(
new
\
DateTime
(
'2012-08-15T00:00:00.000+00:00'
)
)
;
$child
->
setUpdatedAt
(
new
\
DateTime
(
'2017-11-21T11:25:34.000+00:00'
)
)
;
$child
->
internalSetEntityData
(
'media_folder',
new
FieldVisibility
(
[
]
)
)
;
$parent
->
setChildren
(
new
MediaFolderCollection
(
[
$child
]
)
)
;
$product
->
setLength
(
$listProduct
->
getLength
(
)
)
;
$product
->
setLongDescription
(
$listProduct
->
getLongDescription
(
)
)
;
$product
->
setMinStock
(
$listProduct
->
getMinStock
(
)
)
;
$product
->
setReleaseDate
(
$listProduct
->
getReleaseDate
(
)
)
;
$product
->
setShippingTime
(
$listProduct
->
getShippingTime
(
)
)
;
$product
->
setShortDescription
(
$listProduct
->
getShortDescription
(
)
)
;
$product
->
setStock
(
$listProduct
->
getStock
(
)
)
;
$product
->
setWeight
(
$listProduct
->
getWeight
(
)
)
;
$product
->
setWidth
(
$listProduct
->
getWidth
(
)
)
;
$product
->
setPriceGroup
(
$listProduct
->
getPriceGroup
(
)
)
;
$product
->
setCreatedAt
(
$listProduct
->
getCreatedAt
(
)
)
;
$product
->
setUpdatedAt
(
$listProduct
->
getUpdatedAt
(
)
)
;
$product
->
setPriceRules
(
$listProduct
->
getPriceRules
(
)
)
;
$product
->
setCheapestPriceRule
(
$listProduct
->
getCheapestPriceRule
(
)
)
;
$product
->
setManufacturerNumber
(
$listProduct
->
getManufacturerNumber
(
)
)
;
$product
->
setMetaTitle
(
$listProduct
->
getMetaTitle
(
)
)
;
$product
->
setTemplate
(
$listProduct
->
getTemplate
(
)
)
;
$product
->
setHasConfigurator
(
$listProduct
->
hasConfigurator
(
)
)
;
$product
->
setSales
(
$listProduct
->
getSales
(
)
)
;
$product
->
setHasEsd
(
$listProduct
->
hasEsd
(
)
)
;
$product
->
setEsd
(
$listProduct
->
getEsd
(
)
)
;
$product
->
setIsPriceGroupActive
(
$listProduct
->
isPriceGroupActive
(
)
)
;
$product
->
setBlockedCustomerGroupIds
(
$listProduct
->
getBlockedCustomerGroupIds
(
)
)
;
$user
->
setCreatedAt
(
new
\
DateTime
(
'2018-01-15T08:01:16.000+00:00'
)
)
;
$user
->
internalSetEntityData
(
'user',
new
FieldVisibility
(
[
]
)
)
;
$media
=
new
MediaEntity
(
)
;
$media
->
setId
(
'548faa1f7846436c85944f4aea792d96'
)
;
$media
->
setUserId
(
$userId
)
;
$media
->
setMimeType
(
'image/jpg'
)
;
$media
->
setFileExtension
(
'jpg'
)
;
$media
->
setFileSize
(
93889
)
;
$media
->
setTitle
(
'2'
)
;
$media
->
setCreatedAt
(
new
\
DateTime
(
'2012-08-31T00:00:00.000+00:00'
)
)
;
$media
->
setUpdatedAt
(
new
\
DateTime
(
'2017-11-21T11:25:34.000+00:00'
)
)
;
$media
->
setUser
(
$user
)
;
$media
->
internalSetEntityData
(
'media',
new
FieldVisibility
(
[
]
)
)
;
return
$media
;
}
/** * @return array<string, mixed> */
protected
function
getJsonApiFixtures
(
string
$baseUrl
)
: array
{
$user
->
setCreatedAt
(
new
\
DateTime
(
'2018-01-15T08:01:16.000+00:00'
)
)
;
$user
->
internalSetEntityData
(
'user',
new
FieldVisibility
(
[
]
)
)
;
$media
=
new
MediaEntity
(
)
;
$media
->
setId
(
'3e352be2d85846dd97529c0f6b544870'
)
;
$media
->
setUser
(
clone
$user
)
;
$media
->
setUserId
(
$userId
)
;
$media
->
setMimeType
(
'image/jpg'
)
;
$media
->
setFileExtension
(
'jpg'
)
;
$media
->
setFileSize
(
18921
)
;
$media
->
setCreatedAt
(
new
\
DateTime
(
'2012-08-15T00:00:00.000+00:00'
)
)
;
$media
->
setUpdatedAt
(
new
\
DateTime
(
'2017-11-21T11:25:34.000+00:00'
)
)
;
$media
->
setTitle
(
'Lagerkorn-5,0klein'
)
;
$media
->
internalSetEntityData
(
'media',
new
FieldVisibility
(
[
]
)
)
;
$mediaCollection
->
add
(
$media
)
;
$user
->
setMedia
(
$mediaCollection
)
;
return
$user
;
}
/** * @return array<string, mixed> */
$user
->
setCreatedAt
(
new
\
DateTime
(
'2018-01-15T08:01:16.000+00:00'
)
)
;
$user
->
internalSetEntityData
(
'user',
new
FieldVisibility
(
[
]
)
)
;
$media1
=
new
MediaEntity
(
)
;
$media1
->
setId
(
'3e352be2d85846dd97529c0f6b544870'
)
;
$media1
->
setUser
(
$user
)
;
$media1
->
setUserId
(
$userId
)
;
$media1
->
setMimeType
(
'image/jpg'
)
;
$media1
->
setFileExtension
(
'jpg'
)
;
$media1
->
setFileSize
(
18921
)
;
$media1
->
setCreatedAt
(
new
\
DateTime
(
'2012-08-15T00:00:00.000+00:00'
)
)
;
$media1
->
setUpdatedAt
(
new
\
DateTime
(
'2017-11-21T11:25:34.000+00:00'
)
)
;
$media1
->
setTitle
(
'Lagerkorn-5,0klein'
)
;
$media1
->
internalSetEntityData
(
'media',
new
FieldVisibility
(
[
]
)
)
;
$media2
=
new
MediaEntity
(
)
;
$media2
->
setId
(
'f1ad1d0c02454a40abf250f764d16248'
)
;
$media2
->
setUser
(
$user
)
;
$media2
->
setUserId
(
$userId
)
;
$media2
->
setMimeType
(
'image/jpg'
)
;
$media2
->
setFileExtension
(
'jpg'
)
;
$media2
->
setFileSize
(
155633
)
;
$media2
->
setCreatedAt
(
new
\
DateTime
(
'2012-08-17T00:00:00.000+00:00'
)
)
;
if
(
$data
[
'__variant_releasedate'
]
)
{
$product
->
setReleaseDate
(
new
DateTime
(
$data
[
'__variant_releasedate'
]
)
)
;
}
if
(
$data
[
'__product_datum'
]
)
{
$product
->
setCreatedAt
(
new
DateTime
(
$data
[
'__product_datum'
]
)
)
;
}
if
(
$data
[
'__product_changetime'
]
)
{
$product
->
setUpdatedAt
(
new
DateTime
(
$data
[
'__product_changetime'
]
)
)
;
}
$product
->
setAdditional
(
$data
[
'__variant_additionaltext'
]
)
;
$product
->
setEan
(
$data
[
'__variant_ean'
]
)
;
$product
->
setHeight
(
(float)
$data
[
'__variant_height'
]
)
;
$product
->
setLength
(
(float)
$data
[
'__variant_length'
]
)
;
$product
->
setMinStock
(
(int)
$data
[
'__variant_stockmin'
]
)
;
$product
->
setWeight
(
(float)
$data
[
'__variant_weight'
]
)
;
$product
->
setWidth
(
(float)
$data
[
'__variant_width'
]
)
;
$user
->
setCreatedAt
(
new
\
DateTime
(
'2018-01-15T08:01:16.000+00:00'
)
)
;
$user
->
internalSetEntityData
(
'user',
new
FieldVisibility
(
[
]
)
)
;
$media
=
new
MediaEntity
(
)
;
$media
->
setId
(
'548faa1f7846436c85944f4aea792d96'
)
;
$media
->
setUserId
(
$userId
)
;
$media
->
setMimeType
(
'image/jpg'
)
;
$media
->
setFileExtension
(
'jpg'
)
;
$media
->
setFileSize
(
93889
)
;
$media
->
setTitle
(
'2'
)
;
$media
->
setCreatedAt
(
new
\
DateTime
(
'2012-08-31T00:00:00.000+00:00'
)
)
;
$media
->
setUpdatedAt
(
new
\
DateTime
(
'2017-11-21T11:25:34.000+00:00'
)
)
;
$media
->
setUser
(
clone
$user
)
;
$media
->
internalSetEntityData
(
'media',
new
FieldVisibility
(
[
]
)
)
;
$mediaCollection
=
new
MediaCollection
(
[
$media
]
)
;
$user
->
setMedia
(
$mediaCollection
)
;
return
$user
;
}
/** * @return array<string, mixed> */