コード例 #1
0
 /**
  *
  */
 public function atomsstoreAction()
 {
     $atoms = Model_Zupalatoms::getInstance()->findAll('atomic_id');
     $data = array();
     foreach ($atoms as $atom) {
         $row = $atom->toArray();
         $parent = $atom->parent();
         $row['parent_id'] = $parent ? $parent->identity() : 0;
         $data[] = $row;
     }
     $this->_store('id', $data);
 }
コード例 #2
0
 /**
  *
  * @param Model_ZupalatomIF || int $pAtom
  */
 public function set_bond_atom(Model_ZupalatomIF $pAtom)
 {
     if ($pAtom) {
         if (!$pAtom instanceof Model_ZupalatomIF) {
             if (is_numeric($pAtom)) {
                 $pAtom = Model_Zupalatoms::getInstance()->get_atom($pAtom);
             }
         }
         $this->bond_atom = $pAtom->get_atomic_id();
         $this->bond_model_class = $pAtom->get_model_class();
     } else {
         $this->bond_atom = 0;
         $this->bond_model_class = '';
     }
 }
コード例 #3
0
 /**
  *
  * @param boolean $pReload
  * @return Model_Zupalatoms
  */
 function get_atom($pReload = FALSE)
 {
     if (!$this->get_atomic_id()) {
         $this->_spawn_atom();
     } elseif ($pReload || is_null($this->_atom)) {
         $this->_atom = Model_Zupalatoms::getInstance()->get_atom($this->get_atomic_id());
         if (!$this->_atom) {
             $this->_spawn_atom();
         }
     }
     return $this->_atom;
 }
コード例 #4
0
 /**
  *
  * @param string $pReload
  * @return Model_Zupalatoms
  */
 public static function getInstance($pReload = FALSE)
 {
     if ($pReload || is_null(self::$_Instance)) {
         // process
         self::$_Instance = new self();
     }
     return self::$_Instance;
 }