comment on column um_users.first_name
is 'Фамилия';
?<?php
namespace AppBundle\Entity\Dto;
use AppBundle\Other\Arr;
/**
* User
*
*/
class UserDTO
{
/**
*
* @var int
*/
public $id;
/**
*
* @var string
*/
public $login;
/**
*
* @var int
*/
public $dzoId;
/**
*
* @var string
*/
public $dzoName;
/**
* Roles
* @var string
*/
public $roles;
/**
*
* @var string
*/
public $fullname;
/**
*
* @var string
*/
public $email;
public function __construct(\AppBundle\Entity\User $userInfo)
{
$this->id = $userInfo->getId();
$this->login = $userInfo->getUsername();
$dzo = $userInfo->getDzo();
if ($dzo != null) {
$this->dzoId = $dzo->getId();
$this->dzoName = $dzo->getName();
}
$this->roles = $this->plainRoles($userInfo);
$this->email = $userInfo->getEmail();
$this->fullname = $userInfo->getFullname();
}
private function plainRoles(\AppBundle\Entity\User $user)
{
$roles = $user->getRoles();
return join(',', $roles);
}
private function getRolesInfo($str)
{
$parts = explode('-::-', $str);
$roles = [];
foreach ($parts as $p) {
$deserialized = \unserialize($p);
$roles = array_merge($roles, $deserialized);
}
return join(',', array_unique($roles));
}
}
public class UserDTO
{
public string Text { get; set; }
}
void Main()
{
var listOfUsers = new List<UserDTO>
{
new UserDTO { Text = "VkUserName" }
};
var ser = new System.Xml.Serialization.XmlSerializer(typeof(List<UserDTO>));
var sb = new StringBuilder();
var wri = new StringWriter(sb);
ser.Serialize(wri, listOfUsers);
sb.ToString().Dump();
}
// Define other methods and classes here
Database -> Synchronize Model...
, в конце, у вас есть скрипт. Вы просто берете его и применяете через миграцию. CREATE FUNCTION digits( str CHAR(32) ) RETURNS CHAR(32)
BEGIN
DECLARE i, len SMALLINT DEFAULT 1;
DECLARE ret CHAR(32) DEFAULT '';
DECLARE c CHAR(1);
IF str IS NULL
THEN
RETURN "";
END IF;
SET len = CHAR_LENGTH( str );
REPEAT
BEGIN
SET c = MID( str, i, 1 );
IF c BETWEEN '0' AND '9' THEN
SET ret=CONCAT(ret,c);
END IF;
SET i = i + 1;
END;
UNTIL i > len END REPEAT;
RETURN ret;
END
SELECT digits(t.somecol) FROM tablename