コード例 #1
0
 /**
  * @brief Create a new storelocation
  *
  * @param Database  &$database      reference to the database onject
  * @param User      &$current_user  reference to the current user which is logged in
  * @param Log       &$log           reference to the Log-object
  * @param string    $name           the name of the new storelocation (see Storelocation::set_name())
  * @param integer   $parent_id      the parent ID of the new storelocation (see Storelocation::set_parent_id())
  * @param boolean   $is_full        the "is_full" attribute of the new storelocation (see Storelocation::set_is_full())
  *
  * @retval Storelocation            the new storelocation
  *
  * @throws Exception if (this combination of) values is not valid
  * @throws Exception if there was an error
  *
  * @see DBElement::add()
  */
 public static function add(&$database, &$current_user, &$log, $name, $parent_id, $is_full = false)
 {
     return parent::add($database, $current_user, $log, 'storelocations', array('name' => $name, 'parent_id' => $parent_id, 'is_full' => $is_full));
 }
コード例 #2
0
 /**
  * @brief Create a new footprint
  *
  * @param Database  &$database      reference to the database onject
  * @param User      &$current_user  reference to the current user which is logged in
  * @param Log       &$log           reference to the Log-object
  * @param string    $name           the name of the new footprint (see Footprint::set_name())
  * @param integer   $parent_id      the parent ID of the new footprint (see Footprint::set_parent_id())
  * @param boolean   $filename       the filename of the new footprint (IMPORTANT: see Footprint::set_filename())
  *
  * @warning         You have to use the absolute path from filesystem root for $filename, as a UNIX path (only slashes)!!
  *                  More details: Footprint::set_filename()
  *
  * @retval Footprint    the new footprint
  *
  * @throws Exception if (this combination of) values is not valid
  * @throws Exception if there was an error
  *
  * @see DBElement::add()
  */
 public static function add(&$database, &$current_user, &$log, $name, $parent_id, $filename = '')
 {
     return parent::add($database, $current_user, $log, 'footprints', array('name' => $name, 'parent_id' => $parent_id, 'filename' => $filename));
 }
コード例 #3
0
ファイル: class.Category.php プロジェクト: AlexanderS/Part-DB
 /**
  * @brief Create a new category
  *
  * @param Database  &$database                  reference to the database object
  * @param User      &$current_user              reference to the current user which is logged in
  * @param Log       &$log                       reference to the Log-object
  * @param string    $name                       the name of the new category (Category::set_name())
  * @param integer   $parent_id                  the parent ID of the new category (Category::set_parent_id())
  * @param boolean   $disable_footprints         if true, all parts in the new category can't have a footprint (Category::set_disable_footprints())
  * @param boolean   $disable_manufacturers      if true, all parts in the new category can't have a manufacturer (Category::set_disable_manufacturers())
  * @param boolean   $disable_autodatasheets     if true, all parts in the new category won't have automatic datasheets (Category::set_disable_autodatasheets())
  *
  * @retval Category     the new category
  *
  * @throws Exception    if (this combination of) values is not valid
  * @throws Exception    if there was an error
  *
  * @see DBElement::add()
  */
 public static function add(&$database, &$current_user, &$log, $name, $parent_id, $disable_footprints = false, $disable_manufacturers = false, $disable_autodatasheets = false)
 {
     return parent::add($database, $current_user, $log, 'categories', array('name' => $name, 'parent_id' => $parent_id, 'disable_footprints' => $disable_footprints, 'disable_manufacturers' => $disable_manufacturers, 'disable_autodatasheets' => $disable_autodatasheets));
 }
コード例 #4
0
ファイル: class.Device.php プロジェクト: AlexanderS/Part-DB
 /**
  * @brief Create a new device
  *
  * @param Database  &$database                  reference to the database object
  * @param User      &$current_user              reference to the current user which is logged in
  * @param Log       &$log                       reference to the Log-object
  * @param string    $name                       the name of the new device (see Device::set_name())
  * @param integer   $parent_id                  the parent ID of the new device (see Device::set_parent_id())
  *
  * @retval Device       the new device
  *
  * @throws Exception    if (this combination of) values is not valid
  * @throws Exception    if there was an error
  *
  * @see DBElement::add()
  */
 public static function add(&$database, &$current_user, &$log, $name, $parent_id)
 {
     return parent::add($database, $current_user, $log, 'devices', array('name' => $name, 'parent_id' => $parent_id, 'order_quantity' => 0, 'order_only_missing_parts' => false));
 }