예제 #1
0
파일: Parser.php 프로젝트: aazon/sfm
 protected function parseSimple($arrData, $member, $memberReference, $isOwner)
 {
     if (count($arrData) > 2) {
         $simple = $arrData[2];
     } else {
         if ($isOwner) {
             $simple = $this->naming->member2fk($memberReference);
         } else {
             //TODO CRAP CRAP CRAP
             $arrMeta = $this->engine->meta($member);
             $simple = $arrMeta['primary_key'];
         }
     }
     return $simple;
 }
예제 #2
0
파일: Engine.php 프로젝트: aazon/sfm
 /**
  * @param $member
  * @return array
  */
 protected function listMethods($member)
 {
     $arrMeta = $this->assertMember($member);
     if (!isset($arrMeta['methods']['list'])) {
         $arrMethods = array();
         $arrSimple = $this->getSimpleFields($member);
         $arrRelation = array_keys($arrMeta['relations']);
         $arrFields = array_merge($arrSimple, $arrRelation);
         foreach ($arrFields as $key) {
             $arrMethods[$this->naming->key2get($key)] = array('get', $key);
             $arrMethods[$this->naming->key2set($key)] = array('set', $key);
             $arrMethods[$this->naming->key2sort($key)] = array('sort', $key);
             $arrMethods[$this->naming->key2unique($key)] = array('unique', $key);
             if ($this->naming->isFlag($key)) {
                 $arrMethods[$this->naming->key2flagFilter($key)] = array('flag_filter', $key);
                 $arrMethods[$this->naming->key2flagSet($key)] = array('flag_set', $key);
             } else {
                 $arrMethods[$this->naming->key2filter($key)] = array('filter', $key);
             }
         }
         $this->meta[$member]['methods']['list'] = $arrMeta['methods']['list'] = $arrMethods;
     }
     return $arrMeta['methods']['list'];
 }