Added by on 2014-04-27

Bundles
|-> Provides a whole service to project
    (Show Ghost-Armor Bundles, Reference names)

MVC Architecture
|-> Model
    - Entities
        A. Introduce namespace & ArrayCollection
        B. Introduce Annotations
            1. @ORM\Table(name="")
               @ORM\Entity(repository="")

               @ORM\Id
               @ORM\Column(name="", type="")

               @ORM\OneToOne
               @ORM\OneToMany
               @ORM\ManyToOne
               @ORM\ManyToMany

            2. Getter/Setters (alt+insert)

            3. Constructor/toString
    - Form
        A. buildForm() Method
            1. http://symfony.com/doc/2.0/book/forms.html
            2. @Assert\
               (More Info: http://symfony.com/doc/2.0/book/validation.html)
            3. getName() Method (Discussed further in Controller overview)
    - Repository
        A. http://symfony.com/doc/2.0/book/doctrine.html
           http://docs.doctrine-project.org/en/2.0.x/reference/query-builder.html
        B. createQueryBuilder()
            1. select()
            2. innerJoin()
            3. where()
            4. expr()-> // Many SQL functions can be ran using this
            5. orderBy(), groupBy(), setParameter()
        C. getQuery()-> // Need to Specify Result type (Scalar, Object, etc.)

|-> View
    - Resources
        A. TWIG
            1. {% blocks %}
                a. stylesheets
                b. javascripts
                c. title
                d. body
            2. {% extends %} && {{ parent() }} && {% render '' %}
            3. {% if  %}{% else %}{% endif %}
            4. {% for <object/variable> in  %}{% endfor %}
            5. {{  }}
                a. Extenions |
            6. {# comment #}
            7. path('') && asset('')
            8. http://symfony.com/doc/current/book/templating.html
        B. Public
            1. CSS
            2. Javascript
            3. Images
        C. Config
            1. Important if using YML for Routing!!!
            2. Will discuss in Controller due to @Routing Annotations

|-> Controller
    - Controller (http://symfony.com/doc/2.0/book/controller.html)
        A. Tasks
            1. Redirecting
                a. return $this->redirect($this->generateUrl(''));
            2. Rendering
                a. return $this->render('', array('' => ));
                b. array('' => ) // For use with @Template()
            3. Forward
                a. return $this->forward('<template-name', array('' => ));
        B. Action()
            1. http://symfony.com/doc/2.0/bundles/SensioFrameworkExtraBundle/annotations/routing.html
            2. @Route("/{}",
                         name"",
                         requirements={"" = "\d+"},
                         defaults={"" = })
            3. @Method({"GET", "POST"})
            4. @ParamConverter("", class="")
            5. @Template("", vars={""})
        C. Services
            1. $request = $this->getRequest();
            2. $session = $request->getSession
                a. $session->set('foo', 'bar');
                b. $foo = $session->get('foo');
                c. $this->get('session')->setFlash('');
            3. $templating = $this->get('templating');
            4. $router = $this->get('router');
            5. $mailer = $this->get('mailer');

Configuration
|-> App
    - config.yml && parameters.ini
        A. Server configuration
        B. Passwords
        C. Parameters
    - routing.yml
        A. pattern: '/admin'
        B. resource: "@AcmeDemoBundle/Controller/DemoController.php"
        C. type: annotation
        D. prefix: /_
    - security.yml
        A. encoders: // Symfony encryption method default
        B. role: // Define User Roles
        C. firewalls: // Secure routes
        D. access_control: // Restrict routes to certain roles

Commands
|-> Basics
    - generate
        A. generate:bundle
        B. generate:doctrine:entity
        C. generate:doctrine:form
    - doctrine
        A. doctrine:generate:entities
        B. doctrine:generate:form
        C. doctrine:schema
            1. doctrine:schema:create
            2. doctrine:schema:drop
            3. doctrine:schema:update
    - server
        A. server:run
    - Custom using Command File

Doctrine
|-> Entity Manager
    - Mapping
    - Repository
    - Persisting/Flushing
        A. $em->persist()
        B. $em->remove()
        C. $em->flush()
    - find(), findOneById(), findAll(), findByName()
    - Relationships
        A. Object-Oriented
        B. e.g. $employeeAddress = $this->getDoctrine()->getRepository('Bundle:User')->find($id)->getAddress();

|-> Fixtures
    - load()
    - getOrder

Git Introduction
================
|-> Commit & Add
    - git commit -a -m ''
        A. Commits all files different from HEAD with message
    - git add .
        A. Adds newly created files to commit

|-> Branch & Checkout
    - git branch 
        A. List, create, or delete branch
    - git checkout 
        A. Switch to different branch

|-> Pull & Push
    - git pull origin
        A. Request files from git repo (origin is main repository)
    - git push origin master
        B. Sends local files to git repo from master branch

|-> Status & Log
    - git status
    - git log

Category:

Uncategorized

Tags:

, ,

Comments are closed.