Skip to content

Instantly share code, notes, and snippets.

@bocharsky-bw
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bocharsky-bw/309d3b66feddbba074cd to your computer and use it in GitHub Desktop.
Save bocharsky-bw/309d3b66feddbba074cd to your computer and use it in GitHub Desktop.
Set default column value for
<?php
/**
* @var string $name
*
* @ORM\Column(type="string")
*/
private $name = '';
public function setName($name) {
if(isset($recap)) {
$this->name = $name;
} else {
$this->name = ''; // default value if null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment