hi,I am new neos dev,also I am a new phper
I have read example kickstart package neos.blog.In the example,we can edit post ,but now I want to edit blog and post .
My code Lick this:
<f:section name=“Content”>
<f:form action=“update” object="{product}" objectName=“product”>
Title
<f:form.textfield property=“title” id=“title” />
thanks for your help,but I had done like this.The result is
Exception while property mapping for target type “Pim\Product\Domain\Model\Product”, at property path “stocks.0”: Property “stock” was not found in target object of type “Pim\Product\Domain\Model\Stock”.
Nested Exception
Property “stock” was not found in target object of type “Pim\Product\Domain\Model\Stock”.
I show my code to let you know .
my php code
class Product{
/**
The stocks contained in this product
@ORM\OneToMany(mappedBy=“product”)
@ORM\OrderBy({“amount” = “DESC”})
@var Collection
*/
protected $stocks;
public function setStock(Stock $stock){
$this->stocks->add($stock);
}
/**
Adds a stock to this product
@param Stock $stock
@return void
*/
public function addStock(Stock $stock)
{
$this->stocks->add($stock);
}
/**
Removes a stock from this product
@param Stock $stock
@return void
*/
public function removeStock(Stock $stock)
{
$this->stocks->removeElement($stock);
}
}
class Stock{
/**
@Flow\Validate(type=“NotEmpty”)
@ORM\ManyToOne(inversedBy=“stocks”)
@var Product
*/
protected $product;
/**
@return Product
*/
public function getProduct()
{
return $this->product;
}
/**
@param Product $product
@return void
*/
public function setProduct($product)
{
$this->product = $product;
}
}
if this only can use for one to one object not array?
Thanks