public function getSetterCodeObjectbrick($brickClass)
{
$key = $this->getName();
$code = "";
$code .= '/**' . "\n";
$code .= '* Set ' . str_replace(["/**", "*/", "//"], "", $this->getName()) . " - " . str_replace(["/**", "*/", "//"], "", $this->getTitle()) . "\n";
$code .= '* @param ' . $this->getPhpdocType() . ' $' . $key . "\n";
$code .= "* @return \\Pimcore\\Model\\Object\\" . ucfirst($brickClass->getKey()) . "\n";
$code .= '*/' . "\n";
$code .= "public function set" . ucfirst($key) . " (" . '$' . $key . ") {\n";
if (method_exists($this, "preSetData")) {
$code .= "\t" . '$this->' . $key . " = " . '$this->getDefinition()->getFieldDefinition("' . $key . '")->preSetData($this, $' . $key . ');' . "\n";
} else {
$code .= "\t" . '$this->' . $key . " = " . '$' . $key . ";\n";
}
$code .= "\t" . 'return $this;' . "\n";
$code .= "}\n\n";
return $code;
}