+ All Categories
Home > Internet > Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Date post: 09-Jan-2017
Category:
Upload: pehapkari
View: 140 times
Download: 2 times
Share this document with a friend
47
6. sraz přátel Symfony - Bude stovka stačit? Praha, 31. 3. 2016, Usertech
Transcript
Page 1: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

6. sraz přátel Symfony - Bude stovka stačit?Praha, 31. 3. 2016, Usertech

Page 2: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Martin Zeman

@zemistr

Page 3: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Dnešní téma:

Automatizace jednodušše

To není překlep...to je schválně! Přeci jen, je to ukázka automatizace pro kriply. ;-)

Page 4: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Auto … co?

Page 5: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)
Page 6: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Automatizace označuje použití samočinných řídicích systémů k řízení technologických

zařízení a procesů. Z pohledu industrializace jde o krok následující po mechanizaci.

Zatímco mechanizace poskytuje lidem k práci zařízení, které jim usnadňuje práci,

automatizace snižuje potřebu přítomnosti člověka při vykonávání určité činnosti.

https://cs.wikipedia.org/wiki/Automatizace

Page 7: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Automatizace označuje použití samočinných řídicích systémů k řízení technologických

zařízení a procesů. Z pohledu industrializace jde o krok následující po mechanizaci.

Zatímco mechanizace poskytuje lidem k práci zařízení, které jim usnadňuje práci,

automatizace snižuje potřebu přítomnosti člověka při vykonávání určité činnosti.

https://cs.wikipedia.org/wiki/Automatizace

Page 8: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Co můžemeautomatizovat?

Page 9: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Cokoliv … :)

Page 10: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

● Generování dat (statistiky)● Zpracování dat (newsletter)● Spouštění procesů (viz. ↑ )● … osvětlení● … splachování● … fakt cokoliv :)

Page 11: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)
Page 12: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)
Page 13: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)
Page 14: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

$ bin/consoledoctrine:generate:entity

Page 15: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

The Entity shortcut name: Welcome to the Doctrine2 entity generator

This command helps you generate Doctrine2 entities.

First, you need to give the entity name you want to generate.You must use the shortcut notation like AcmeBlogBundle:Post.

Page 16: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

AppBundle:PostConfiguration format (yml, xml, php, or annotation) [annotation]: Determine the format to use for the mapping information.

New field name (press <return> to stop adding fields): Instead of starting with a blank entity, you can add some fields now.Note that the primary key will be added automatically (named id).

Available types: array, simple_array, json_array, object, boolean, integer, smallint, bigint, string, text, datetime, datetimetz, date, time, decimal, float, binary, blob, guid.

Page 17: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

titleField type [string]: Field length [255]: Is nullable [false]: Unique [false]:

New field name (press <return> to stop adding fields): key Name "key" is a reserved word.

New field name (press <return> to stop adding fields): ukeyField type [string]: Field length [255]: 50Is nullable [false]: trueUnique [false]: true

Page 18: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Entity generation

> Generating entity class ...\AppBundle\Entity\Post.php: OK!> Generating repository class ...\AppBundle\Repository\PostRepository.php: OK!

Everything is OK! Now get to work :).

Process finished with exit code 0 at 14:41:16.Execution time: 1 032 236 ms.

Page 19: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

/*** @ORM\Table(name="post")* @ORM\Entity(repositoryClass="AppBundle\Repository\PostRepository")*/class Post{ /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id;

/** * @var string * * @ORM\Column(name="title", type="string", length=255) */ private $title;

/** * @var string * * @ORM\Column(name="ukey", type="string", length=50, nullable=true, unique=true) */ private $ukey;

Page 20: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

$ bin/consoledoctrine:generate:entity

Page 21: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

$ bin/consoledoctrine:generate:entity

--entity=AppBundle:Post

Page 22: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

$ bin/consoledoctrine:generate:entity

--entity=AppBundle:Post--no-interaction

Page 23: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

$ bin/consoledoctrine:generate:entity

--entity=AppBundle:Post--fields="title:string(255)"

--no-interaction

Page 24: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

--fields= " ukey:string( length=50 unique=true nullable=true ) title:string(255) "

Page 25: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

$ bin/consoledoctrine:generate:entity

--entity=AppBundle:Post--fields="ukey:string(length=50

unique=true nullable=true)title:string(255)"--no-interaction

Page 26: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

/*** @ORM\Table(name="post")* @ORM\Entity(repositoryClass="AppBundle\Repository\PostRepository")*/class Post{ /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id;

/** * @var string * * @ORM\Column(name="title", type="string", length=255) */ private $title;

/** * @var string * * @ORM\Column(name="ukey", type="string", length=50, nullable=true, unique=true) */ private $ukey;

Page 27: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

$ bin/consoledoctrine:generate:entity

--entity=AppBundle:Post--fields="ukey:string(length=50

unique=true nullable=true)title:string(255)"--no-interaction

Page 28: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

1.

Page 29: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

2.

Page 30: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)
Page 31: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

AppBundle:$Prompt$

Page 32: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)
Page 33: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)
Page 34: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

...\php.exe bin/console doctrine:generate:entity --entity=AppBundle:Post "--fields=ukey:string(length=50 unique=true nullable=true) title:string(255)" --no-interaction Entity generation > Generating entity class ...\AppBundle\Entity\Post.php: OK!> Generating repository class ...\AppBundle\Repository\PostRepository.php: OK!

Everything is OK! Now get to work :).

Process finished with exit code 0

Page 35: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

/** * @var string * * @ORM\Column(name="`key`", ...) */private $key;

Page 36: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

/*** @var string** @ORM\Column(* name="body",* type="text",* nullable=true* )*/private $body;

Page 37: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

$ bin/consoledoctrine:generate:entities

Page 38: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

$ bin/consoledoctrine:generate:entities

AppBundle:Post

Page 39: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

1.

Page 40: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

2.

Page 41: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)
Page 42: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

AppBundle:$FileNameWithoutAllExtensions$

Page 43: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)
Page 44: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

...\php.exe bin/console doctrine:generate:entities AppBundle:Post

Generating entity "AppBundle\Entity\Post" > backing up Post.php to Post.php~ > generating AppBundle\Entity\Post

Process finished with exit code 0

Page 45: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

/*** Set body** @param string $body* @return Post*/public function setBody($body){ $this->body = $body;

return $this;}

/*** Get body** @return string*/public function getBody(){ return $this->body;}

Page 46: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Čas na volnou debatu

Page 47: Automatizace jednoduše [Martin Zeman] (6. sraz, Praha, 31.3.2016)

Otázky?


Recommended