Passed
Push — master ( 5928a0...6c7f1e )
by dima
02:51
created

example/Domain/City/CityMapper.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/*
3
 * To change this license header, choose License Headers in Project Properties.
4
 * To change this template file, choose Tools | Templates
5
 * and open the template in the editor.
6
 */
7
8
namespace Test\Domain\City;
9
10
use 
11
	SimpleORM\AbstractDataMapper;
12
13
/**
14
 * Description of PriceMapper
15
 *
16
 * @author d.lanec
17
 */
18
class CityMapper extends AbstractDataMapper
19
{
20
	/**
21
	 * таблица
22
	 * @var type 
23
	 */
24
	protected $table = '__test_city';
25
	
26
	/**
27
	 * создаем сущность
28
	 * 
29
	 * @param array $row
30
	 * @return type
31
	 */
32
	public function createEntity(array $row) {
33
		return $this->buildEntity(new City(), $row);
0 ignored issues
show
The call to City::__construct() misses a required argument $name.

This check looks for function calls that miss required arguments.

Loading history...
34
	}	
35
	
36
	/**
37
	 * Настройка полей
38
	 */
39
	protected function setMappingFields() {
40
		
41
		//вариант 1
42
		$this
43
				->addMappingField('id', [
44
					'field'		 => 'cty_id',
45
					'primary'	 => true
46
					]
47
				)
48
				->addMappingField('name','cty_name')
49
			;
50
51
	}	
52
	
53
	
54
}
55