diff --git a/app/model/Database/Entity/AbstractEntity.php b/app/model/Database/Entity/AbstractEntity.php index 653636d..deeddb3 100644 --- a/app/model/Database/Entity/AbstractEntity.php +++ b/app/model/Database/Entity/AbstractEntity.php @@ -4,5 +4,5 @@ namespace App\Model\Database\Entity; abstract class AbstractEntity { - + use \Nette\SmartObject; } diff --git a/app/model/Database/Entity/Attributes/TId.php b/app/model/Database/Entity/Attributes/TId.php index 4760e89..38d05cf 100644 --- a/app/model/Database/Entity/Attributes/TId.php +++ b/app/model/Database/Entity/Attributes/TId.php @@ -10,6 +10,8 @@ trait TId * @ORM\Column(type="integer", nullable=FALSE) * @ORM\Id * @ORM\GeneratedValue + * + * @property int $id */ private $id; diff --git a/app/model/Database/Entity/DictType.php b/app/model/Database/Entity/DictType.php index 4c6ca39..4649dce 100644 --- a/app/model/Database/Entity/DictType.php +++ b/app/model/Database/Entity/DictType.php @@ -10,6 +10,10 @@ use Doctrine\Common\Collections\Collection; /** * @ORM\Entity(repositoryClass="App\Model\Database\Repository\DictTypeRepository") * @ORM\HasLifecycleCallbacks + * + * @property int $id + * @property String $shortName + * @property String $fullName */ class DictType extends AbstractEntity { diff --git a/app/model/Database/Entity/Suffix.php b/app/model/Database/Entity/Suffix.php index 05de4e2..9ed5475 100644 --- a/app/model/Database/Entity/Suffix.php +++ b/app/model/Database/Entity/Suffix.php @@ -8,6 +8,8 @@ use App\Model\Database\Entity\Attributes\TId; /** * @ORM\Entity(repositoryClass="App\Model\Database\Repository\SuffixRepository") * @ORM\HasLifecycleCallbacks + * + * @property String $text */ class Suffix extends AbstractEntity { diff --git a/app/model/Database/Entity/Term.php b/app/model/Database/Entity/Term.php index dc5f787..7222a35 100644 --- a/app/model/Database/Entity/Term.php +++ b/app/model/Database/Entity/Term.php @@ -9,6 +9,16 @@ use App\Model\Database\Entity\Attributes\TId; * @ORM\Entity(repositoryClass="App\Model\Database\Repository\TermRepository") * @ORM\HasLifecycleCallbacks * @ORM\Table(indexes={@ORM\Index(columns={"string1"}, flags={"fulltext"}),@ORM\Index(columns={"string2"}, flags={"fulltext"})}) + * + * @property int $id + * @property String $string1 + * @property String $string2 + * @property Dictionary $dictionary + * @property Suffix $suffix1 + * @property Suffix $suffix2 + * @property DictType $type + * @property int $order2 + * @property String $member */ class Term extends AbstractEntity { @@ -59,12 +69,6 @@ class Term extends AbstractEntity */ protected $pronunciations; - public function setType(DictType $type) - { - $this->type = $type; - return $this; - } - /** * @ORM\Column(type="string",nullable=true) */ @@ -115,6 +119,106 @@ class Term extends AbstractEntity + + /** + * Get the value of string1 + */ + public function getString1() + { + return $this->string1; + } + + /** + * Set the value of string1 + * + * @return self + */ + public function setString1($string1) + { + $this->string1 = $string1; + + return $this; + } + + /** + * Get the value of string2 + */ + public function getString2() + { + return $this->string2; + } + + /** + * Set the value of string2 + * + * @return self + */ + public function setString2($string2) + { + $this->string2 = $string2; + + return $this; + } + + /** + * Get the value of suffix1 + */ + public function getSuffix1() + { + return $this->suffix1; + } + + /** + * Set the value of suffix1 + * + * @return self + */ + public function setSuffix1($suffix1) + { + $this->suffix1 = $suffix1; + + return $this; + } + + /** + * Get the value of suffix2 + */ + public function getSuffix2() + { + return $this->suffix2; + } + + /** + * Set the value of suffix2 + * + * @return self + */ + public function setSuffix2($suffix2) + { + $this->suffix2 = $suffix2; + + return $this; + } + + /** + * Get the value of type + */ + public function getType() + { + return $this->type; + } + + /** + * Set the value of type + * + * @return self + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } } ?> diff --git a/app/modules/Front/Home/HomePresenter.php b/app/modules/Front/Home/HomePresenter.php index 7cade9a..38e0aaa 100644 --- a/app/modules/Front/Home/HomePresenter.php +++ b/app/modules/Front/Home/HomePresenter.php @@ -88,14 +88,14 @@ final class HomePresenter extends BaseFrontPresenter if ($clen) $query->withClen($clen); $result = $this->em->getTermRepository()->fetch($query)->setFetchJoinCollection(FALSE); - + if ($paginate) { - $this["paginator"]->setItemCount($result->getTotalCount()); + $this["paginator"]->setItemCount(count($result)); $result->applyPaginator($this['paginator']); $offset = $this['paginator']->getOffset(); $itemsPerPage = $this['paginator']->getItemsPerPage(); } - */ + */ $t = $this->em->getTranslationRepository()->find($translation); $this->template->translation = $t; diff --git a/app/modules/Front/Home/templates/default.latte b/app/modules/Front/Home/templates/default.latte index 230ad7c..0635779 100644 --- a/app/modules/Front/Home/templates/default.latte +++ b/app/modules/Front/Home/templates/default.latte @@ -44,16 +44,15 @@ $( document ).ready(function() { - {ifset $result} - {dump $result} +
| Vyraz | Preklad | Typ | Member |
|---|---|---|---|
| {$term->string1}{if $term->suffix1} {$term->suffix1->text}{/if} | {$term->string2}{if $term->suffix2} {$term->suffix2->text}{/if} | @@ -73,3 +72,4 @@ $( document ).ready(function() { {/block} +